Use {{abs}} to return the absolute value of a number. You can pass in a numeric field from the record or a hard-coded number.
{{abs number}}
-
number: A numeric value or a field that resolves to a number (e.g.,
-123,"120.5", orrecord.amountDue).
-
Handling a negative order total
{{abs record.total}}If
record.totalis-45.67, this outputs45.67. -
Explicit numeric value
{{abs "-123"}}Returns
123. -
Using an amount due field
{{abs record.amountDue}}If
record.amountDueis"100", the output remains100.
Tip
-
Ensure the field you pass in is numeric (or can be parsed as numeric). Non-numeric values may result in unexpected behavior.
-
The returned value preserves decimals if the input is a floating-point number.