w2utils.formatNumber

Formats a number adding commas.
formatNumber(val, [groupSymbol], [decimalSymbol])
val string or number, a number to format
groupSymbol string, a group delimiter (default is comma)
decimalSymbol string, a group delimiter (default is dot)
The val argument can be an integer, float on in money format. The method will add commas (or whatever groupSymbol you defined) after each there digits. This method will also format number with a specified decimalSymbol. Both groupSymbol and decimalSymbol are defined in w2utils.settings

User Comments

comments powered by Disqus