format
String
format
(
nData
,
oConfig
)
Takes a native JavaScript Number and formats to string for display to user.
- Parameters:
-
nData <Number>
Number. -
oConfig <Object} (Optional) Optional configuration values:
- prefix {String}
- String prepended before each number, like a currency designator "$"
- decimalPlaces {Number}
- Number of decimal places to round.
- decimalSeparator {String}
- Decimal separator
- thousandsSeparator {String}
- Thousands separator
- suffix {String>
- String appended after each number, like " items" (note the space)
- Returns:
String
- Formatted number for display.