The FormatCurrency function is a built-in function that builds a Text output of the specified Currency value, preceded by the currency symbol, using dec_digits after the decimal point. The decimal point is specified using dec_separator, while thousands can be separated with the grp_separator.

When rounding, the function behaves differently depending on the application server you are using or where the function is used:

- In a .NET application server, applies the method round half up (rounds to the nearest integer, 0.5 rounds up).

- In a J2EE application server, applies the method round half to even (rounds to the nearest integer, 0.5 rounds to the nearest even integer).

Input parameters

value: Currency Type

symbol: Text Type

dec_digits: Integer Type

dec_separator: Text Type

grp_separator: Text Type

Output parameters

Text Type

Examples

Usage

Result

FormatCurrency( 1.2, "$" , 1, "#", "." )

"$ 1#2"

FormatCurrency( 1.2, "$", 3, ",", "." )

"$ 1,200"

FormatCurrency( 1.24, "$", 1, ",", "." )

"$ 1,2"

FormatCurrency( 1.25, "$", 1, ",", "." ) "$ 1,3" (in a .NET application server) or "$1,2" (in a J2EE application server)

FormatCurrency( 1.251, "$", 1, ",", "." )

"$ 1,3"

FormatCurrency( 1.35, "$", 1, ",", "." )

"$ 1,4"

FormatCurrency( 12345.67, "$", 2, ",", "." )

"$ 12.345,67"

FormatCurrency( -12345.67, "$", 2, ",", "." )

"$ -12.345,67"

See Also

Available Formatting Functions | Available Built-in Functions