$$numberformat
Formats a number
Usage​
"$$numberformat(<type>,[locale],[compact_style]):{input}"
"$$numberformat(DECIMAL,[locale],[pattern],[grouping],[decimal]):{input}"
"$$numberformat(BASE,[radix]):{input}"
Returns​
string
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
type | Enum | NUMBER /DECIMAL /CURRENCY /PERCENT /INTEGER /COMPACT /BASE | Yes | Type of output format |
locale | Enum | A language tag (e.g. en-US ) | en-US | Locale to use (language and country specific formatting; set by Java) |
compact_style | Enum | SHORT /LONG | SHORT | Effective when type == COMPACT , choose which type of compact |
pattern | String | DecimalFormat pattern | #0.00 | See tutorial |
grouping | String | Single character string | , | A custom character to be used for grouping |
decimal | String | Single character string | . | A custom character to be used for decimal point |
radix | Integer | 10 | Radix to be used for formatting input | |
currency | String | ISO-4217 currency code | Yes (when type == CURRENCY ) | Currency to use in format |
Examples​
Input
Definition
Output
123456789.87654321
"$$numberformat(DECIMAL):$"
"123456789.88"
123456789.87654321
"$$numberformat(DECIMAL,en-US,'#,##0.00'):$"
"123,456,789.88"
123456789.87654321
"$$numberformat(DECIMAL,en-US,'#,##0.00','.',','):$"
"123.456.789,88"
123456789.87654321
"$$numberformat(CURRENCY):$"
"$123,456,789.88"
123456789.87654321
"$$numberformat(CURRENCY,en-GB,GBP):$"
"£123,456,789.88"
123456789.87654321
"$$numberformat(PERCENT):$"
"12,345,678,988%"
123456789.87654321
"$$numberformat(INTEGER):$"
"123,456,790"
123456789.87654321
"$$numberformat(COMPACT):$"
"123M"
123456789.87654321
"$$numberformat(COMPACT,en-US,LONG):$"
"123 million"
123456789
"$$numberformat(BASE,16):$"
"75bcd15"
10
"$$numberformat(BASE,2):$"
"1010"