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.

Syntax

FormatNumber(number,decimals,language)

FormatNumber(123456.789, 2) => 123456,78 (when the currentlanguage has the comma for decimal point)

FormatNumber(123456.789, 2, en_US) => 123456.78

FormatNumber(number,decimals,grouping,language)

FormatNumber(123456.789, 2, true) => 123.456,78 (when the currentlanguage has the comma for decimal point)

FormatNumber(123456.789, 2, true, en_US) => 123,456.78

Parameters

NameTypeRequiredDescription

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