The abs helper returns the absolute value of a number, removing any negative sign. Use it to normalize negative values -- for example, converting a credit amount or refund total to a positive number for downstream processing.
Syntax
{{abs number}}
number -- The numeric value to evaluate. Required. Accepts a number, numeric string, or field reference. Non-numeric values produce unexpected results.
Examples
Remove the negative sign from a field value
{{abs record.total}}
Input: record.total is -45.67
Output: 45.67
Pass a hard-coded negative value
{{abs "-123"}}
Output: 123
Pass a positive value (no change)
{{abs record.amountDue}}
Input: record.amountDue is "100"
Output: 100
Positive values pass through unchanged.
Usage notes
- The input must be numeric or parseable as numeric. Non-numeric values produce unexpected results.
- Decimal values are preserved:
{{abs "-45.67"}}returns45.67. - Positive values are returned unchanged.