ABS()
All functions > MATH > ABS()
Returns the absolute value of a number.
Signatures
Absolute value
Returns: The absolute (non-negative) value
ABS(number: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | The number to take the absolute value of |
With:
T: Any numeric type
Signature notes:
- Preserves the input type
- Returns NULL if the input is NULL
ABS(0) = 0
Examples
FeatureQL
SELECT
f1 := ABS(-10), -- Negative integer
f2 := ABS(5), -- Positive integer
f3 := ABS(0), -- Zero
f4 := ABS(-3.7E0) -- Negative decimal
;Result
| f1 BIGINT | f2 BIGINT | f3 BIGINT | f4 VARCHAR |
|---|---|---|---|
| 10 | 5 | 0 | 3.7 |
On this page