> This page is for version Scripted.
> For other versions, use one of these documentation indexes:
> - Generative (default): https://developers.ada.cx/generative/llms.txt
> - Scripted: https://developers.ada.cx/scripted/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.ada.cx/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.ada.cx/_mcp/server.

# Calculate values using the Answer Utilities block

## Overview\[#UUID-161d4679-6262-9464-d231-38b837862685_id_1500011229221_id_h_01F60BKCGVDN5XG0EV541MF3SS]

Use the Calculate action to perform basic math operations. You can
calculate static values added when you set up the action, or dynamic
values captured in
[variables](/scripted/docs/build-and-maintain-your-bot/personalize-conversations/get-started-with-variables).
The result of the calculation is always captured in a variable.

### Available operations

* Addition (+)

* Subtraction (-)

* Multiplication (\*)

* Division (/)

* Exponentiation (^)

* Use parentheses () to modify the order of operations.

![](/_fern-files/_img/c828783b8a436d657858aebe431e4dd37fbb23c8cc2d9ec0717d4a43c6891467.webp)

### Configure the Calculate action\[#UUID-161d4679-6262-9464-d231-38b837862685_id_1500011229221_id_h_01F60BKKRQBR3975MERYKY4AVX]

1. Click the Select Action drop-down menu and select Calculate. The
   Expression input field appears.

2. Add an equation to the **Expression** field. You can use static
   numbers or variables exclusively or in combination.

3. To determine the number of decimal places to round the result to,
   click the **Select Optional Inputs** drop-down menu and select
   **Precision**.

   * Use an integer to specify the number of decimal places.

     **Example:** Entering `5` rounds the calculation result to five
     decimal places. `0` rounds to the nearest integer (no decimal
     places).

   * If no precision is set, the result is not rounded and all decimal
     places are shown.

4. Click the **Save Response as Variable** drop-down menu and select
   **Calculated Answer**.

5. Select an existing variable or create a new variable to capture the
   result of the calculation.

6. Click the **Fallback Answer** drop-down menu and select an Answer to
   display if an error occurs during the block’s operation.

7. Click **Save**.

The Calculated Answer variable can now be used in other Answer messaging
or processes as required.

---

Have any questions? Contact your Ada team, or email us at [](<mailto:help@ada.support%20%E2%80%9CHelp Docs inquiry%E2%80%9D>).