Formidable Pro makes it easy to perform calculations using values entered in your form. You may perform basic numeric calculations, separate value numeric calculations, or text calculations.

### Numeric calculations

If you would like to perform a calculation where the numeric value used in a calculation can be seen by the user, follow the directions below.

- Go into edit your form.
- Add a
**Number**field to calculate the total. Set it to 'Read Only' if you would like users to see, but not edit, the total.

If you do not want users to see the total, set the Visibility to 'Administrator'. - In the Field Options for the total field, select
**Calculate the default value for this field**.

- Use the
**Select a value to insert into the box below**dropdown to add fields to your calculation. You can use the field ID or key synonymously in a calculation. Your calculation might look something like: [25]+[26]+[27] or ([25]*8)+([27]/2). In the example below, two Number fields are multiplied:

- Enter the number of
**decimal places**for your total. - The total will be updated each time a field that is used in your calculation is changed.

You can use the total field value in your success message, email, or View. If you would like your users to make a payment with this total, you can pass the total amount to Paypal or Stripe.

### Separate value calculations

Follow the directions below if you would like to perform a calculation where the value used in a calculation is not seen by the user. For example, if you have a radio button field with two options (Gold, Silver), then the text must be converted to numbers before calculating the total.

- Go into edit your form.
- Check
**Use separate values**for each field that will be used in your calculation (this can be found in the Field Options for Dropdown, Radio Button, and Checkbox fields).

- Add the number that will be used in your calculation to the end of each saved value. The calculation will only use numbers and decimals from the end of each saved value. Any other text or numbers before this will be ignored.

*Please note that the saved value***cannot**be identical to any other saved value. If you have saved values that must have the same numeric value, they need to be entered like this: Gold - $25.00, Silver - $25.00. - Add a
**Number**field to calculate the total. Set it to 'Read Only' if you would like users to see, but not edit, the total.

If you do not want users to see the total at all, set the Visibility to 'Administrator'. - In the Field Options for the total field, select
**Calculate the default value for this field**.

- Use the
**Select a value to insert into the box below**dropdown to add fields to your calculation. You can use the field ID or key synonymously in a calculation. Your calculation might look something like: [25]+[26]+[27] or ([25]*8)+([27]/2). In the example below, we are simply adding two fields together:

- Enter the number of
**decimal places**for your total. - The total will be updated each time a field that is used in your calculation is changed.

### Text calculations

If you would like to combine text from multiple fields into a single field in your form, you may use Formidable's text calculations. Follow the directions below to concatenate multiple field values into a text field.

- Go into edit your form.
- Add a
**Single Line Text**field to your form. This field will contain the combined text. - Go into the field options and scroll down to
**Dynamic Values**. Select 'Calculate the default value for this field ' and 'This calculation is copying text'.

- Use the
**Select a value to insert into the box below**dropdown to add fields to your calculation. Any spaces or characters used in this box will show in the final value.

- Save your form and preview it. The value will be updated each time a field that is used in your calculation is changed.

### Calculate a user's age

If you would like to calculate a user's age when they enter their date of birth, follow the instructions below.

- Add a
**Date**field to your form. This will be the 'Date of birth' field. - Add a
**Number**field to your form and title it 'Age'. This is the field where the age will be calculated. - If you want the user to see the age, select 'Read Only'.

If you do not want the user to see the 'Age' field, then set the field Visibility to 'Administrator'. - In the field options select
**Calculate the default value for this field**. Insert this calculation into the box:[age id=25]

Replace '25' with the ID or key of your 'Date of birth' field.

- Now when the user inserts their birthday, the age will show up in the 'Age' field.

### Number Format

- If you would like to round your total to two decimal places, enter
**2**in the 'decimal places' box. - If you would like to round your total to the nearest whole number, enter
**0**in the 'decimal places' box. - If you would like to round a number down to its nearest integer, add
**Math.floor**to the beginning of your calculation.

Math.floor([25]+[26]+[27])

- If you would like to add a dollar sign in front of your number, go into your form and click on 'Settings' → 'Customize HTML'. Find the box that corresponds to the field holding the number. Put a dollar sign in front of [input].

If the dollar sign appears above the field, you need to decrease the field size.

### Advanced numeric calculations

- If you would like to add exponents to an equation, you can use
**Math.pow**:Math.pow([x],2)

Replace x with a field ID for the base and replace 2 with the exponent amount.

- For more advanced calculations, such as minimums, maximums, and square roots, see the JavaScript Math object.

### Calculation demo

To see a calculations demo, click here.