Arithmetic Function Syntax

S-Docs templates support arithmetic functions for both numeric fields and static numbers. All functions should be written using standard Salesforce math operators. S-Docs will evaluate all functions using the standard mathematical order of operations.

To use arithmetic functions within S-Docs templates, simply enclose the function within <MATH> tags.

The following example uses both static numbers and fields.

DOCX Syntax

When using arithmetic functions in DOCX templates, be sure to enclose the entire function within square brackets, as shown in the following example.

Formatting Numbers

Number formatting for arithmetic functions is supported within <MATH> tags, but not within merge fields themselves. If you want to format the result of the operation, use the format-number attribute within the <MATH> tag as shown below, but not within your merge fields.

Note: When you insert numeric fields using the Insert Field button, number formatting is added to the merge fields automatically. Ensure that you remove this formatting when using merge fields within arithmetic functions.