# Calculated Field

This field can take the values from the form fields and meta fields and use them to calculate the formula you’ve set. The formula can be of any complexity. If you write it to the formula text area correctly, the field will be able to calculate it. The field can take values from the Number, Text, or Textarea Fields and work together with Hidden and Repeater Fields.

## Field Settings

So, this field was created to perform calculations. There are three types of values you can use here:

• Static numbers. Those could be either whole or fraction numbers;
• Form field value. It works with the Number, Text, and Textarea Fields. To get the value, use the macro code %FIELD::field_name%, where “field_name” is the title you put to the Form field name bar;
• Meta field value. The value will be taken from the meta field that is attached to the post where you have placed the form. To get the value, use the macro code %META::field_name%, where “field_name” is the name of the field.

You can do all sorts of mathematical operations with those values. Just type the formula into the Calculated Field text area. For example, let’s take a close look at the formula:

(%FIELD::quantity%+2)*%META::price%

This means that the field will take the value from the “quantity” form field, add 2 to it, and then will multiply the result by the value of the “price” meta field.

Despite the fact that you type the formula to the field’s text area, the users will see only the result of calculations. The features of the Field Settings section allow you to customize the look of that result:

• Decimal Places Number. Here you can set the number of the digits that will be displayed to the right from the decimal point;
• Calculated Value Prefix. You can type the text that will be shown before the resulting value here;
• Calculated Value Suffix. The text you type here will be displayed after the calculated value.

You can make this field invisible for the users by turning the Hidden toggle on.

## Style Settings

So, this field was created to perform calculations. There are three types of values you can use here: