Skip to main content

$$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​

ArgumentTypeValuesRequired / Default ValueDescription
typeEnumNUMBER/DECIMAL/CURRENCY/PERCENT/INTEGER/COMPACT/BASEYesType of output format
localeEnumA language tag (e.g. en-US)en-USLocale to use (language and country specific formatting; set by Java)
compact_styleEnumSHORT/LONGSHORTEffective when type == COMPACT, choose which type of compact
patternStringDecimalFormat pattern#0.00See tutorial
groupingStringSingle character string,A custom character to be used for grouping
decimalStringSingle character string.A custom character to be used for decimal point
radixInteger10Radix to be used for formatting input
currencyStringISO-4217 currency codeYes (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"