FormatNumber
The FormatNumber() function converts a number to text according to the specified format.
This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a new text string that is the formatted text representation of a number.
Returns Invalid expression if numberis unknown or the indicated format is not valid for numeric values.
If decimals are part of the original value, and the number of allowed decimals in the formatting is less, there will be a standard rounding effect as well.
Syntax
FormatNumber(number,decimals,language)
FormatNumber(123456.7813, 2)
=> 123456,78 (when the currentlanguage has the comma for decimal point)
FormatNumber(123456.789, 2, en_US)
=> 123456.79 (rounding up)
FormatNumber(123456.789, unknownnumber)
=> unknown
FormatNumber(number,decimals,grouping,language)
FormatNumber(123456.7813, 2, true)
=> 123.456,78 (when the currentlanguage has the comma for decimal point)
FormatNumber(123456.789, 2, true, en_US)
=> 123,456.79 (rounding up)
FormatNumber(12345.6789, 3, false)
=> 12345.679 (rounding up)
FormatNumber(unknownnumber, unknownnumber, unknownboolean)
=> unknown
Parameters
number
numeric
☑️
a value of any type.
decimals
numeric
☑️
the number of decimals that are included in the returned text
grouping
yes/no
☑️
a boolean that indicates if large numbers are grouped (a separator is used)
language
language keyword
this parameter is used to specify the number representation according to the specified language/culture.
If the language parameter is not specified or contains an unknown value, then the default portal language is used to format the number.
Last updated
Was this helpful?