Formatting of Currency and Number Fields (Ver.1)

When outputting to Word, PowerPoint, or PDF files, the merge fields with data type Currency or Number can be formatted.

*This procedure is for Office File Creator Ver.1. For Ver.2, refer to Formatting of Currency and Number Fields.

Examples of Use

  • Output number fields of 1,000 or more with comma. Example: 1000 -> 1,000
  • When the number of decimal places in a number field exceeds the number of digits in the field, the number of decimal places is larger than the number of digits in the field. The same number of digits as the field definition should be output. Example: The field has two decimal places, but the value stored in Salesforce is 5.124, so 5.124 is output. 5.12 should be output, which is the same as the number of field digits, as in the Salesforce display screen.
  • When the decimal point of a currency field is 0, the number of decimal places is less than the number of field digits. The number of digits defined in the field should be output. Example: In the case of 3.10, 3.1 is output, but need to output 3.10, which is the same as the number of field digits.

 

Default Formatting for Currency and Number Fields

When outputting to Word, PowerPoint, or PDF, the following formatting is applied by default to currency and number fields.

Currency

Formatted (With a comma delimiter, the number of decimal places follows the field definition in principle. However, trailing zeros are not displayed, and up to three decimal places are shown. e.g. 3.10 -> 3.1)

*The format follows the behavior of the Apex format() method.

 

Number

No formatting (No comma delimiter and the Decimal point is the number of digits in the field in principle. However, if a value greater than the digits in the field definition is stored in Salesforce, the actual value is displayed).

 

OFC_Template Record Settings

Open the OFC_Template Object record detail page and enter the field values in the "(Optional) Number and Currency Fields" section.

Adjust Format (commas/decimal places): When output in Word, PowerPoint, or PDF, check this field to output number field values of 1,000 or more with three-digit comma separators. The number of decimal places for both currency and number values is the number of digits defined in the field.

Rounding Mode of Decimals over Digits: If "Adjust Format (commas/decimal places)" is checked, select the rounding mode when the number of decimal places exceeds the number of digits defined in the field. If left blank, the default is "HALF_UP" (round half up).

 

For more information on rounding modes, refer to the following.

Decimal Class

 

Note

  • When outputting to Excel, the merge fields cannot be formatted. Format the cells in the template file.

 

Reference

Ver.1 New Version Released – Added Formatting Options for Numerical and Currency Fields, etc.