Handlebars formatCurrency
Handlebars formatCurrency: formats a number as a currency value for a locale.
Next
Runtime verified
Differs from official docs
Test scripts included
Formats a number as a currency value for a locale.
Syntax
{{formatCurrency number [cultureCode]}}
Returns string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
number |
number | Yes | The number to format as currency. |
cultureCode |
string | No | Locale code. Defaults to en_US. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{formatCurrency 1234.56 "en-US"}}renders$1,234.56, as documented.{{formatCurrency 1234.56 "de-DE"}}renders1.234,56 €. The documented result is1.234,56 €(the space before€is a non-breaking space in the output).{{formatCurrency 1234.56 "ja-JP"}}renders¥1,235, as documented.
Show Next test script
Differs from official docs
- The reference shows the
de-DEresult as1.234,56 €with an ordinary space before the euro sign. In Marketing Cloud Next (tested 2026-11-22):{{formatCurrency 1234.56 "de-DE"}}rendered1.234,56 €with a non-breaking space (U+00A0) before€. It looks identical, but a plain text comparison against the documented value fails.en-USandja-JPmatched the docs. Details
Marketing Cloud Next
Differs from the documentation
en-US and ja-JP render as documented. de-DE renders 1.234,56 € with a non-breaking space before the euro sign, where the documentation shows a normal space. It looks the same, but a plain text comparison fails. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.
See also
- AMPscript
FormatCurrency— does a similar job in AMPscript, with a different call shape - Official reference