Skip to main content

$abs

$abs(number?) -> number
Compact type signature<n-:n>

If number is omitted, the current context value is used.

Browse categories

Source: JSONata

Documentation

Returns the absolute value of the number parameter, i.e. if the number is negative, it returns the positive value.

Examples

Basic usage

  • $abs(5) => 5
  • $abs(-5) => 5

Absolute value for a derived score

Input

-18

Expression

$abs($)

Result

18