> For the complete documentation index, see [llms.txt](https://guide.plumber.gov.sg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.plumber.gov.sg/user-guides/actions/calculator.md).

# Calculator

### Perform a calculation

Use this action to add, subtract, multiply, or divide two numbers.

| Field                     | Description                                | Required? |
| ------------------------- | ------------------------------------------ | --------- |
| Number to transform       | The first number in your calculation.      | ✔️        |
| Math operation to perform | Select Add, Subtract, Multiply, or Divide. | ✔️        |
| Value                     | The second number in your calculation.     | ✔️        |

The output is stored as **Result**, which you can use in later steps.

### Round number

Use this action to round a number to a set number of decimal places.

| Field           | Description                                                                                                                          | Required? |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------- |
| Number to round | The number you want to round.                                                                                                        | ✔️        |
| Rounding        | Select Round Down (always rounds towards zero), Round Up (always rounds away from zero), or Round Off (rounds to the nearest value). | ✔️        |
| Decimal places  | The number of decimal places to round to. Enter a whole number.                                                                      | ✔️        |

The output is stored as **Result**, which you can use in later steps.

### Common errors

<details>

<summary>Ensure that you have entered valid numbers</summary>

This error occurs when a field receives a value that isn't a number, for example a text string or an empty variable.

Check that all fields contain numeric values. If you're using a variable, make sure the step it comes from is returning a number.

</details>
