Mathematical field

The Mathematical field block in Greyd Forms allows you to perform advanced calculations within your forms. It supports both static values and dynamic input from other fields, making it ideal for use cases such as cost estimations, score calculations, or conversions. After inserting the block into the editor, you can immediately build your desired formula using form fields and mathematical operators.

Screenshot of Mathematical field Block with its form fields and mathematical operators.

You can directly write and modify the formula in the block editor. Below the input field, you can find all available fields that can be used in the form, if they hold numerical values.

The supported operators include addition (+), subtraction (-), multiplication (*), division (/), exponentiation (^()), square root (√()), logarithm (log()), and parentheses for grouping (( and )).

Settings

Screenshot of the Settings tab of Mathematical field block, explained in the following paragraphs.

In the General section, you change the automatically prepopulated field name that will be submitted with the form. There’s also a toggle to show the result and show the formula in the frontend. An additional toggle labeled Change field value depending on condition is available, which lets you customize mathematical fields on conditions. See the next section for more details.

The Rounding and decimal places section allows you to control the precision and formatting of the result. You can set the number of decimal places (default is 0), choose the rounding behavior (automatically, round up, or round off), and choose from a selection of different decimal and thousand separators.

Under Pre- & Suffix, you can configure text elements that appear before or after the calculated value. This is useful for adding a currency symbol, unit of measurement, or other explanatory labels. These settings only affect the display, not the submitted field value.

Refer to the separate Animation documentation for details about adding animations to the field.

The block also supports Animations. In the Advanced section, you can find settings for additional CSS classes and toggles to hide the block per breakpoint.

Change field value depending on condition

Screenshot of conditional field value, explained in the following paragraphs.

If the option is activated, a new section below the mathematical field is added in the editor. In this, you see three similar sections, allowing you to define conditions based on the available user input fields.

In the If section, you define the value that is going to be checked. In the condition dropdown, you pick one of these options:

  • Greater (>)
  • Greater than or equal to (>=)
  • Smaller (<)
  • Smaller than or equal to (<=)
  • Equals (=)

In the Than section, you add the value the condition is checked on. In the Then section, you can define a different formula that is used when this condition is met.

Video

You are currently viewing a placeholder content from Vimeo. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information