Runtime verified Differs from official docs Test scripts included

Returns the sum of two numbers, rounded to 2 decimal places.

Syntax

{{add value1 value2}}

Returns number.

Parameters

Name Type Required Description
value1 number Yes First value to add.
value2 number Yes Second value to add.

Example

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

  • {{add 2 3}} renders 5, as documented.
  • {{add "1.5" 2.25}} breaks the email preview (HTTP 500). The documented result is 3.75.
Show Next test script
<!-- Marketing Cloud Next test script for the add 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=[5] got=[{{add 2 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) -->
{{add "1.5" 2.25}}

Differs from official docs

  • The reference says add accepts numbers or strings that convert to numbers, handles decimals, and rounds the sum to two decimal places. In Marketing Cloud Next (tested 2026-11-22): {{add "1.5" 2.25}} let the email save and publish, but the preview then failed with HTTP 500 and no message instead of rendering 3.75. Whole numbers work: {{add 2 3}} rendered 5. Details

Marketing Cloud Next

See also