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.
When using arithmetic functions in DOCX templates, be sure to enclose the entire function within square brackets, as shown in the following example.
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.