Introduction
Note: These features are part of the Visforms Subscription and are not included in the free Visforms version.
The Visforms Subscription adds new field types to Visforms, which can be used to solve special requirements. The “Calculation” field type allows you to create mathematical formulas.
With the help of this field type it is possible to create an individually designed sales form. In addition to mathematical operations (plus, minus, times, divided) and functions (such as root, square, absolute value and many more), the formulas can also use the current user input. The form calculates the result dynamically based on the current user input.
System requirements
The Visforms Subscription must be installed.
Range of functions
What you can do with the extension is best shown in an example form: Form with calculation.
The structure of the sample form with all the associated formulas is explained in the documentation. More in: Instructions for sales form.
Explanations on usage
Example
In the Formula configuration field, enter the expression to be calculated.
Example:
([BOOK]*25.00)+[DISCOUNT]
Inputs for placeholders
You can use Visforms placeholders for form field values in the formals.
Permitted entries for placeholders in the Formula field are the field names in capital letters enclosed in square brackets:
[FIELD NAME]
Mathematical operators
The following mathematical operators are available:
- +
- -
- *
- /
Mathematical functions
The following mathematical functions are available:
- abs()
- sin()
- asin()
- asinh()
- cos()
- acos()
- acosh()
- tan()
- atan()
- athanh()
- ceil()
- exp()
- floor()
- max()
- min()
- log()
- log10()
- log1p()
- pow()
- round()
- sqrt()
Important instructions
Period as a decimal separator in the formula
All numbers with decimal places must contain a period as a decimal separator in the Formula configuration field. This does not correspond to the German-speaking area, where the comma is usually used.
“Decimal separator” configuration option for the display
You can use the Decimal Separator configuration option to set the decimal separator for display.
The configuration option Decimal separator determines which decimal separator should be used:
- For displaying the calculated result.
- When saving the data in the database.
Do not use thousands separators
Values included in the calculation must never contain a thousands separator:
- Be it from the string in the Formula field itself.
- Be it from values that come from other fields.
Avoid spaces
Avoid spaces in the formula.