You can use the mathematical logic type in XFP to build up a mathematical formula that XFP can evaluate.
Creating a mathematical logic
In your form, click Logic in the top navigation bar (under the the form title).
Click Add Logic.
You will be taken to the logic designer, where you can build your logic.
Give your logic a name, so you can find it again later.
Choose Mathematical as the type.
Enter your formula in the appearing box. You can drag and drop blocks from the toolbar, or type in the area where it says start typing.
- Pressing enter will finish a block and start a new one
- The formula box will automatically finish some blocks for you and start a new one, for instance if you type '+'.
- You can navigate the cursor between blocks with the arrow keys
- Typing '[' in an empty block will open the variable picker
Blocks can be removed by deleting their content with backspace, or by dragging them to the trash can.
NOTE Your formula must be a valid mathematical formula, or you will be unable to save it.
Click Save. You can now use this logic in your form.
NOTE The variable picker allows you to insert placeholder variables. These will be replaced by the corresponding proper value when the logic runs.