Format a Template
The formatting options listed below all follow the same structure. Update the value field with the field you wish to format and include the proper formatting details to ensure the field displays in the desired manner.
Format | Example | Notes | |
---|---|---|---|
Formatting a Number | {format(value, {number, 2})} | {format({!NU__TotalPrice__c}, {number, 2})} | Two decimal places will display a number such as 21.99 whereas zero decimal places will just display 22. |
Formatting a Currency | ${format(value, {number, 2})} | ${format({!Amount}, {number, 2})} | |
Formatting a Date | {format(value, {date, MM/dd/yyyy hh:mm:ss})} | {format({!CloseDate}, {date, EEEEE, MMMMM d})} | MM/dd/yyyy hh:mm:ss will be the format of the date you wish to display, but you do not need to use MM/dd/yyyy hh:mm:ss as your date format, this is just an example format. You can use any of the standard Salesforce datetime formats in your template: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html |
Formatting a Date with a Timezone | {format(value, {date, MM/dd/yyyy hh:mm zz})} | {format({!StartDate__c} , {date, M/d/yyyy hh:mm zz})} | |
Formatting a Checkbox | {format(value, {boolean, 0})} | Value will be the checkbox field that you wish to format as either Yes or No. When the checkbox value is TRUE, the displayed value will be “Yes.” When the checkbox value is FALSE, the displayed value will be “No.” |