The currency format switch (\#) formats numeric Salesforce fields, such as revenue, amounts and prices, as currency values in your document. Use it so financial figures look consistent and follow professional and regional standards.
Syntax
{{Object.Field \# FormatPattern}}
{{Object.Field \# Currency}}
Values
| Value | Effect |
|---|---|
A number pattern, such as #,##0 or $#,##0.00 | Formats the number exactly as the pattern shows: thousand separators, a symbol, and the decimal places written after the point. |
Currency | Locale-based currency formatting. It uses the org-level locale by default, unless you override it with a CurrencyCulture parameter. |
A culture name, such as CurrencyCulture1 | Formats with the culture defined on the solution. See CurrencyCulture. |
Where to add it
Add \# and the pattern after the field name inside the merge field in your Word template.
Example
Input: an account whose Annual Revenue is 125000.
| Format | Syntax | Output |
|---|---|---|
| Number with thousand separator | {{Account.AnnualRevenue \# #,##0}} | 125,000 |
| USD with no decimals | {{Account.AnnualRevenue \# $#,##0}} | $125,000 |
| USD with two decimal places | {{Account.AnnualRevenue \# $#,##0.00}} | $125,000.00 |
| Locale-based currency formatting | {{Account.AnnualRevenue \# Currency}} | ₹1,25,000.00 (if the IN locale is set) |
Works in
Word (DOCX) templates: the examples on this page are Word template fields.
Notes
- The
Currencykeyword uses the org-level locale by default, unless you override it with the CurrencyCulture parameter. - To get the same formatting in every region, define the culture explicitly, for example
CurrencyCulture1=de-DEfor German euro formatting.
Common errors
- The amount has no decimals or too many. Change the pattern:
#,##0has no decimals,$#,##0.00has two. See Format numbers. - The currency symbol is wrong or missing.
\# Currencyformats by locale. DefineCurrencyCulture1on the solution and use\# CurrencyCulture1instead. See Dates, numbers or currency show the wrong format. - The separators are wrong (
89,000.02instead of89.000,02). Use NumberCulture. - The document shows the tag, or a blank, instead of the amount. See Merge fields are blank or show their tags.