Question about inserting commas

Hello.

I have been working on a calculator for an annual incentive plan that displays several dollar amounts (old salary, new salary, bonus, etc.). I have found a few functions for doing the conversion but I can’t seem to figure out how to get this into the fla for it to work properly.

Basically I have some code pulling from input boxes:


//12 Month AIP calculations
var AIPmonthRaw = Math.round(Number(baseSalary.text) - newBase);
var AIPmonth = Math.round(AIPmonthRaw * Number (.01)) * 100;

At this point I want to convert the AIPmonth var to have a comma (ie 25,000) when it displays in the dynamic text box.

The same would go for about 4 other different amounts displaying in other dynamic boxes.

The two formatters I was looking at were found here:
http://www.actionscript.org/actionscripts_library/Math_Object/more5.shtml

Thanks in advance.