Format Number as Currency
Just had the need to format some numbers into different currencies the other day so I made a simple, generic function to do the trick.
Example:
var dollars:String = "$" + currencyFormat(343769.5);
var euro:String = "€ " + currencyFormat(150, 2, ".", ",")
var nok:String = currencyFormat(10500, 2, ".", ",") + ",-"
trace(dollars) // $343,769.50
trace(euro) // €150,00
trace(nok) // 10.500 ,-
source:
function currencyFormat [...]
