Handlebars add
Handlebars add: returns the sum of two numbers, rounded to 2 decimal places.
Next
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}}renders5, as documented.{{add "1.5" 2.25}}breaks the email preview (HTTP 500). The documented result is3.75.
Show Next test script
Show calls that fail in Next (one email each)
Differs from official docs
- The reference says
addaccepts 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 rendering3.75. Whole numbers work:{{add 2 3}}rendered5. Details
Marketing Cloud Next
Differs from the documentation
Whole numbers work: {{add 2 3}} gives 5. A decimal passed as a string, {{add "1.5" 2.25}}, breaks the email preview (HTTP 500) instead of giving the documented 3.75. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.
See also
- AMPscript
Add— the AMPscript equivalent - Official reference