Handlebar 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.

This helper is available in the Winter ’26 release of Marketing Cloud Next (API version 65.0).

ParameterTypeDescription
value1Number or StringRequired. The first value to subtract from. Must be a number or convertible to a number.
value2Number or StringRequired. The second value to subtract. Must be a number or convertible to a number.

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.