> For the complete documentation index, see [llms.txt](https://docs.documint.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsubtract.md).

# $subtract

#### Signature <a href="#subtract" id="subtract"></a>

`{{$subtract number1 number2 [format]}}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>number1</td><td>The first number in a subtraction.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>number2</td><td>The second number in a subtraction.</td><td><span data-option="6a3ca9c830be4cd5a2bcf10d17c44f82">Number</span></td><td>true</td></tr><tr><td>format</td><td><a href="/pages/-M_x4dVDz1v6rNxxMMP9#standard">Format string</a> used to format the result</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### **Returns**

Returns the total.

**Example**

{% tabs %}
{% tab title="Template" %}

```javascript
{{$subtract subtotal discount}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
    "subtotal":100,
    "discount": 21.5
}
```

{% endtab %}

{% tab title="Result" %}
78.5
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/functions/math/usdsubtract.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
