Skip to main content

$$numberformat

Formats a number

Usage

{ 
"$$numberformat": /* Number to format */,
"type": "NUMBER" /* or DECIMAL / CURRENCY / PERCENT / INTEGER / COMPACT / BASE */
}
"$$numberformat([type]):{input}"
note

Concrete values in the usage example are default values.

Returns

string

Arguments

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryBigDecimalYesNumber to format
typeenumNUMBER/ DECIMAL/CURRENCY/PERCENT/INTEGER/COMPACT/ BASENUMBERType of output format

Examples

Input

Definition

Output

123456789.87654321
"$$numberformat:$"
"123,456,789.877"
123456789.87654321
"$$numberformat():$"
"123,456,789.877"
123456789
"$$numberformat:$"
"123,456,789"
1.9999
"$$numberformat:$"
"2"
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.87654321
"$$numberformat(COMPACT,he-IL,LONG):$"
"‏123 מיליון"
123456789.87654321
"$$numberformat(BASE,16):$"
"75bcd15"
123456789.87654321
"$$numberformat(BASE,2):$"
"111010110111100110100010101"