Articles in this section

abs helper

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.

Usage

{{abs number}}
  • number: A numeric value or a field that resolves to a number (e.g., -123, "120.5", or record.amountDue).

Examples

  1. Handling a negative order total

    {{abs record.total}}
    

    If record.total is -45.67, this outputs 45.67.

  2. Explicit numeric value

    {{abs "-123"}}
    

    Returns 123.

  3. Using an amount due field

    {{abs record.amountDue}}
    

    If record.amountDue is "100", the output remains 100.

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.