Expressions - Math

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.

 

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 template 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.

Feedback

Invalid Input

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

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

Invalid Input

Applies To

Docmosis-Java Tornado Cloud
Version(s) 4.0.3, 4.1.0, 4.2.0, 4.3.0, 4.3.1, 4.4.0, 4.4.1, 4.4.2, 4.5.0 (Latest) 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.8.0, 2.8.1 (Latest) ALL

Related items