Apply calculations to a text element

Basic syntax

The [calculate] BBCode allows you to display the result of a mathematical formula directly in the content.

[calculate formula="1 + 1"]

This will display the result of the operation (in this case, 2).

Static values

You can use numbers and mathematical operators (+, -, *, /, ()), for example:

[calculate formula="(10 * 2) / 5"]

Result: 4.

Dynamic values

It is also possible to use names of other fields instead of fixed numbers. For example, if you have fields called price and quantity, you could calculate:

[calculate formula="price * quantity"]

This will automatically display the multiplied value of those fields.

In this way, [calculate] is useful both for simple calculations and for dynamic formulas that depend on other data.