ABS

Description

ABS returns the absolute value of a number, i.e. its distance from zero regardless of sign.

Syntax

ABS(number)

Returns: A non-negative number.

Example

ABS(-42)

This returns 42.

ABS(7.5)

This returns 7.5.

Example in context

p is Person
ABS(p.account_balance)

Returns the magnitude of the account balance without regard to whether it is positive or negative. Useful when you need the size of a deviation, e.g. ABS(p.target - p.actual) > 1000.

Last updated

Was this helpful?