Expressions - Math

This example introduces the notation used to perform simple math calculations in the templates.

It explains how to call math functions and format the results that are displayed in the generated document.

It is best to view the template and output files side-by-side to understand the calculations being performed.

Math calculations

You can perform math within your template by enclosing the expression in curly brackets.

For example: << { 10.0 * 5.5 } >> will calculate and display 55.0 in the generated document.

Math can be performed on the data being inserted in to the template.

Formatting

The results of calculations may need to be formatted using other functions to achieve the desired result in the generated document.

For example: << { round ( 10.0 * 5.5 ) } >> will round the result and display 55 in the generated document.

For a complete discussion on formatting please see the Format - Numbers example.

Math functions

The Docmosis template syntax includes common math functions like round, maximum, minimum, power and square root.

For a full list of all functions please refer to the Template Guide or the Quick Reference Guide.

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input