Expressions - Math

Category : Technical Examples

This example introduces the notation used to perform simple Math and Logic calculations in your templates.

It explores how to call Math functions and format the results that are displayed in the finished document.

Data Files
Output Files
All Files as a ZIP

This example explained

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


1) Math Calculations

You can perform Math within your tempalte by enclosing the expression in curly brackets.

  For example: << { 10.0 * 5.5 } >>

  Will display: 55.0, in the finished document.

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


2) Formatting

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

  For example: << { round ( 10.0 * 5.5 ) } >>

  Will display round the result and display: 55, in the finished document.

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


3) Logic Calculations

You can perform Logic operations such as comparisons ( less than, greater than, equal to ) as well as AND/OR within the template, which is most useful in Conditional Sections.

Try changing the data value for "length" so that it is greater than and less than 1000 to see the effect in the finished document.


4) Math Functions

For a full list of Math Functions see the Quick Reference download link below.