Use the round helper to convert a numeric value (including a string representation of a number) to the nearest whole integer. This is commonly used for rounding tax, totals, or any decimal-based fields in a record.
{{round field}}
-
field: The field or variable containing a decimal or numeric-like string (e.g.,
record.vat).
-
Rounding a tax amount
If
record.vatis"29.77", then:{{round record.vat}}results in
30. -
Rounding down
If
record.discountis19.4,{{round record.discount}}yields19. -
Using triple braces (though generally not needed for numbers)
{{{round record.fee}}}Returns the raw rounded value without any automatic string formatting (e.g., quotes).
Tip
-
If the field is already an integer (e.g.,
42),roundreturns the same value. -
Ensure the field contains a valid numeric string; otherwise,
roundmay produce unexpected results or an error. -
Consider other numeric helpers (if available) if you need more precise decimal handling or control over rounding (e.g., to a specified number of decimal places).