# Numbers: Perform basic math

Use this action to add, subtract, multiply, or divide fields.

This action is powerful when used between actions that handle integer or decimal fields, for example:

• Calculate the latest average when a new row is added to a table.
• Perform math outside of a table, such as multiplying the time and hourly rate on a finished job.
• Create a counter that increases by 1 every time an action or Workflow runs. Use this to create new ID’s for incoming issues or tickets by adding 1 to the last ID number.

## How to configure this action The basic math function can be used to calculate averages, create a counter, or any other math functions using the `(` `)` `+` `-` `*` `/` operators.

This action uses the 6 operators above. For more advanced math, use Javascript with the Field: Field Formulas action.

### Fields for this action • #### Calculation • Input the calculation to perform, using numbers, operators, and fields in `{{field}}` format. Allowed operators are `(` `)` `+` `-` `*` `/`.
• For example, `({{inventory}}*4)/2`, or `{{price}}*{{quantity}}`
• #### Decimal Places • Choose the number of decimal places included in the output. If 0 is entered, the field will be returned as an integer. If blank, the maximum number of decimal places will be returned.
• #### Output Field Prefix • To help keep output fields organized, choose an output field prefix to add to the beginning of each output field name as this action may output more than one field.
• The step’s name is used as the prefix by default.

## What will this output? The action will output the calculation result, as well as a status field. This action also outputs any field used in the equation, these fields output under their given field name.

This action may generate multiple fields. To help keep output fields organized, the prefix above will be added to the beginning of each of the output field names, separated by two dashes. Each field will result as:`{{output-field-prefix--output-field}}`. Learn more

### Output fields for this action • #### Output • This result of the calculation, as an integer or decimal field type depending on the Decimal Places configuration.
• #### Status • If the calculation is successful, the status is `Completed`. If there is an error, the field will output the error message. This includes messages like:
• `Error - Unexpected end of expression (char #)`: A field was added to the calculation, but did not have a value.
• `Error - Value expected (char #)`: A field was added to the calculation, but did not have a value.
• `Error - Invalid calculation provided`: The equation could not resolve, typically because there was a string instead of a number, or an incorrect use of an operator.