The FormatDecimal function is a built-in function that builds a Text output of the specified Decimal value, using dec_digits after the decimal point. The decimal point is specified using dec_separator, while the thousands can be separated with the grp_separator.

When rounding, the following strategy is used:

Input parameters

value: Decimal Type

dec_digits: Integer Type

dec_separator: Text Type

grp_separator: Text Type

Output parameters

Text Type

Examples

Usage

Result

FormatDecimal( 1.2, 1, "$", "." )

"1$2"

FormatDecimal( 1.2, 3, ",", "." )

"1,200"

FormatDecimal( 1.23, 1, ",", "." )

"1,2"

FormatDecimal( 1.24, 1, ",", "." )

"1,2"

FormatDecimal( 1.25, 1, ",", "." )

"1,3"

FormatDecimal( 12345.67, 2, ",", "." )

"12.345,67"

FormatDecimal( -12345.67, 2, ",", "." )

"-12.345,67"

See Also

Available Formatting Functions | Available Built-in Functions