This article will teach you how to override the default currency format in your template and choose your own.
Let's say you would like to display “$235,000.00” as the Opportunity amount in your document rather than “235000,” which is the default formatting for the currency field. You can do this in one of two ways. The first option is to use S-Docs formatting, and the second is to use a Salesforce formula field.
To format currency using S-Docs syntax, you can simply add the correct formatting directly within your merge fields (add a space after the merge field name, followed by the currency format you would like):
You can add this formatting yourself, or use the Insert Field button within the template editor to do so; currency options will appear for currency fields.
If the number/currency field is located in a related list column, you would need to edit the template source. Click the Source button and then locate the number/currency field within your template. You then need to replace the syntax to match the following:
<column format-number="#,###">quantity</column> <column format-number="#,###.##" prefix="$">unitprice</column> <column format-number="#.###,##" postfix="€">euro_price__c</column>
The example above shows the three supported formatting options. For others, you can use a formula field described below.
By adding the following formula field to your object, you leverage built-in Salesforce functionality. You would need to substitute your field name into the formula below (in place of “Amount”), and then drop the formula field into your S-Docs template. You do not need to add any of these fields to any page layout. You can add the dollar sign ($) to either the start of the formula or within the template design document proceeding your field.
IF( Amount >= 1000000, TEXT(FLOOR(Amount / 1000000)) & ",", "") & IF( Amount >= 1000, RIGHT(TEXT(FLOOR(Amount / 1000)), 3) & ",", "") & RIGHT(TEXT(FLOOR(Amount)), 3) & "." & IF(< MOD(Amount , 1) * 100 < 10, "0" & TEXT(ROUND(MOD(Amount , 1), 2) * 100), TEXT(MIN(ROUND(MOD(Amount , 1), 2) * 100, 99)) )