FormatCurrency

This function formats a string as a currency for the specified locale.

NOTE: By default, this function rounds half up to two decimal places.

Arguments

FormatCurrency(1,2,3,4)

Ordinal Type Required Description
1 String True Currency string to format
2 String True ISO locale code for the currency unit
3 Number False Decimal places to include in the output
4 String False Currency symbol for output. This overrides the currency symbol specified by the ISO locale code

Example 1

%%[

var @num
var @currency
var @locale

set @num = "123.45678"
set @locale = "en-US"
set @currency  = FormatCurrency(@num, @locale)

]%%
num: %%=v(@num)=%%
<br>locale: %%=v(@locale)=%%
<br>currency: %%=v(@currency)=%%

Output

num: 123.45678
locale: en-US
currency: $123.46

Example 2


Not a subscriber? Subscribe now.

Example 3


Not a subscriber? Subscribe now.