---
schema_version: "1"
id: 10ef462e7a5cb5011dddb18015b57f180e7257be2d4c14f3c1b4aed338e13fd4
title: "Handlebars Helper Function: subtract"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/math/mcn-handlebars-reference-math-subtract.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-math-references/mcn-handlebars-reference-math-subtract.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 27085d0f47d020098cbe299072695332538a10cc6d39594c43b8e040b1a1e197
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: subtract

Subtracts two numeric arguments and returns their difference. The function can handle both integer and floating-point numbers, and attempts to convert strings to numbers.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{subtract value1 value2}}
```

## Parameters

| Parameter | Type             | Description                                                                              |
| --------- | ---------------- | ---------------------------------------------------------------------------------------- |
| `value1`  | Number or String | Required. The first value to subtract from. Must be a number or convertible to a number. |
| `value2`  | Number or String | Required. The second value to subtract. Must be a number or convertible to a number.     |

## Return Value

The function returns the arithmetic difference of the two input values. If you provide more than two arguments, the operation subtracts only the first two. The result is always a number rounded to 2 decimal places.

If either input is a string, the operation tries to convert it to a number. If a string value can’t be converted to a number, the operation throws an exception.
