/ Published in: ActionScript 3
Format a number so it is more humanly readable. It allows for setting the number of decimal places (inc. adding 0000s to the end) and separating thousands with a comma.
Example usage:
trace(numberFormat(1234.695, 2, true, false));
// Output: 1,234.70
trace(numberFormat(16000000, 0, false, false));
// Output: 16,000,000
Example usage:
trace(numberFormat(1234.695, 2, true, false));
// Output: 1,234.70
trace(numberFormat(16000000, 0, false, false));
// Output: 16,000,000