all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

need help on a currency function.


need help on a currency function. Richard Ragon
4/2/2005 5:51:22 PM
flash actionscript:
Anyone have a function to turn a number into a currency string?

Here's what I have so far..

// function to return a string with Dollar Sign and Commas
function figureOutCash (numberNow) {
var calMoney:String = "$"+numberNow;
return calMoney;
};

This only adds the "$" to the front of the current value of numberNow.
I need to also add in comas too..

So, if I send it a number of 10000, I want to return a string of
"$10,000.00".

Thanks!
Re: need help on a currency function. Richard Ragon
4/3/2005 12:10:41 AM
[quoted text, click to view]

I did.. Seams a little complex. It's well documented with code comments
though.

Re: need help on a currency function. kglad
4/3/2005 4:27:27 AM
AddThis Social Bookmark Button