Fields
Calculations
Let a template do the math on the numbers you enter, like hours times rate.
Calculations are Smart Fields that do the math on numbers you enter, like hours times rate, so a rich snippet works out a total for you. Add them in the rich text editor with {{.
The four calculations
They’re under Insert field > Calculations:
| Calculation | What it does |
|---|---|
| Add Fields | Adds two or more fields together |
| Subtract Fields | Takes each following field away from the first |
| Multiply Fields | Multiplies two or more fields |
| Divide Fields | Divides the first field by each following field |
Build an invoice line
- In a rich snippet, add two Text fields:
hoursandrate. Use Insert field > Basic Fields > Text, or saved Fields. - Type
{{and choose Multiply Fields. - Click the new pill. Under Fields to calculate, select
hoursandrate. - Click Save changes.
Design work: {{hours}} hours at ${{rate}}/hour = ${{multiply}}
When you insert it, enter 12.5 and 80, and the snippet says = $1000.
Tips
- A calculation needs at least two fields in the same snippet. It can also use the result of another calculation, so a subtotal can feed a total.
- Fields are calculated in the order you select them, which matters for Subtract and Divide.
- The math is exact to 12 decimal places. Add a
roundTransform to tidy the result. - Numbers are read using the Number format in Settings. With
1.234,56, type12,5for twelve and a half. - A calculation can’t depend on itself. SimpleFill stops you if a chain would loop.
Where they work
Calculations work inside rich snippets and Blocks only. Typing ;multiply on a page does nothing, because there’s nothing to calculate there.
To show different text depending on a number, use a condition.