The FormatCurrency() function has four parameters:
number (string or number): Required. The number that you want to format. This function assumes that the input number uses a period or full stop (.) as a decimal separator. If you input the number as a string, the function assumes that commas are used as thousands separators.
cultureCode (string): Required. The locale code to use when formatting the number. Locale codes can use POSIX format (such as es_MX) or BCP 47 format (such as es-MX). When you provide this value, the resulting number is formatted using patterns that suit the specified locale.
decimalPlaces (number): The number of decimal places to include in the result. If you don’t provide a value, the resulting number has two decimal places. If you’re specifying a value for the currencySymbol parameter, then this parameter is required.
currencySymbol (string): The currency symbol to use with the value. If you provide a value for this parameter, it overrides the default currency symbol for the specified locale.
Usage
To use the function, pass it a number to format, and culture code that you want to use to format it. This example converts a number to a currency value that is formatted based on the United Kingdom locale (en_GB).
%%=FormatCurrency(1234.555,"en_GB")=%%
The function returns £1,234.56.
Rounding or Adding Precision
The function can output a currency value that is rounded to a certain decimal place, or that adds precision to the currency value.
This example rounds the input number to the nearest whole number.
1%%=FormatCurrency(1234.555, "de_CH", 0)=%%
The example outputs CHF 1'235.
In some currencies, decimal divisions aren’t commonly used. For example, in Japan, the smallest unit of currency in current use is ¥1, and fractional divisions of the yen are uncommon. For this reason, the FormatCurrency() function rounds to the nearest yen by default. However, you can force the function to output a currency value by specifying a value for the third parameter, as in this example.
1%%=FormatCurrency(1234.555, "ja_JP", 2)=%%
The example outputs ¥1,234.56.
Using Alternative Currency Symbols
You can force the function to output a currency value that uses a specific currency symbol. For example, many currencies use the dollar sign ($). You can use this feature to add information that helps the reader determine which currency you’re referring to. When you specify a currency symbol, you must also specify the number of decimal places to include in the output. This example replaces the default currency symbol for the Mexican peso ($) with an alternative (Mex$) that makes it easier to identify the currency being used.