> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/user/template-builder/template-dynamic-fields/formula-field.md).

# Formula Field

Use **Formula field** to display a calculated value in a template.

It’s a calculated field. Participants don’t type the value manually.

You can place this field in:

* structured documents
* PDF documents

### Add a formula field

{% columns %}
{% column %}

1. Open the template in edit mode.
2. In the **Fields** panel find **Formula field** and add it to the template.
3. Configure the field and click **Save**.
   {% endcolumn %}

{% column %}

<figure><img src="/files/ye3ro0ebaPyWAPt7yXFy" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Field settings

Click on the placed field to reopen settings menu.

{% columns %}
{% column %}

* **Name** — field name shown in the document
* **Placeholder** — hint text shown before calculation (if empty, **Name** is used)
* **Tooltip** — additional hint shown on hover
* **Operation** — operation applied to arguments
* **Argument 1** — argument used for calculation
* **Precision** — number of decimal places (leave empty for no limit)
* **Search** — makes the field available for search/filtering in the mailbox UI (if enabled in your setup)
* **Adapt to the local format** — formats numbers using the participant’s region settings
* **Show decimal zeroes** — adds trailing zeroes to match **Precision**
  {% endcolumn %}

{% column %}

<figure><img src="/files/u0WIo3Ke9wnXMU8JltHo" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% hint style="info" %}
You can type a static number directly into an argument field.
{% endhint %}

#### Precision behavior

If the calculated value has more decimals than **Precision**, extra decimals are trimmed.

No rounding is applied.

Example:

* `1.99` → `1.9` when **Precision** is `1`
* `1.99` → `1` when **Precision** is `0`

{% hint style="info" %}
In the envelope view, number formatting depends on the region selected on the **User profile** page.

In printable versions, numbers always use the platform region standard.
{% endhint %}

### Available operations

Operations for any argument fields:

* **SUM** — arguments sum
* **PRODUCT** — arguments multiplication result
* **SUBTRACT** — arguments subtraction result
* **DIVIDE** — arguments division result

Operations for dynamic tables only (select a field from the target column):

* **SUM table column** — column values sum
* **COUNTA table column** — count of non-empty cells
* **MIN table column** — smallest value in the column
* **MAX table column** — largest value in the column

### Supported argument types

You can use these fields as arguments:

* **Number**
* **Currency**
* **Dictionary**
* **Lookup**
* **Duplicate**
* **Formula field**

#### How non-numeric values are parsed

If you use **Dictionary**, **Lookup**, or **Duplicate** as an argument, the value is parsed as a number.

All symbols except digits and the last period are ignored.

If there are several periods, only the last one is treated as the decimal separator.

Example:

* `Abc@/.1.1.1` + `Abc@/.1.1.1` with **SUM** → `22.2`
