Runtime verified Differs from official docs Test scripts included

Returns the difference of subtracting the second value from the first.

Syntax

{{subtract value1 value2}}

Returns number.

Parameters

Name Type Required Description
value1 number Yes The value to subtract from.
value2 number Yes The value to subtract.

Example

Tested in a Marketing Cloud Next email on 2026-11-22:

  • {{subtract 5 3}} renders 2, as documented.
  • {{subtract 1.5 2.25}} breaks the email preview (HTTP 500). The documented result is -0.75.
Show Next test script
<!-- Marketing Cloud Next test script for the subtract helper. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[2] got=[{{subtract 5 3}}]</p>

Show calls that fail in Next (one email each)
<!-- Run each call below in its own Next email: one of them in a combined email
     would stop the whole preview or block the save. -->

<!-- email 1: expect that the email saves, but the preview fails (HTTP 500) -->
{{subtract 1.5 2.25}}

Differs from official docs

  • The reference says subtract handles decimals as well as whole numbers and rounds the difference to two decimal places. In Marketing Cloud Next (tested 2026-11-22): {{subtract 1.5 2.25}} let the email save and publish, but the preview then failed with HTTP 500 and no message instead of rendering -0.75. Whole numbers work: {{subtract 5 3}} rendered 2. Details

Marketing Cloud Next

See also