ABS
All functions > MATH > ABS
Returns the absolute value of a number.
Signatures
Returns: The absolute (non-negative) value
ABS(number: T) → T sql
| Parameter | Type | Required | Description |
|---|---|---|---|
number | T | Yes | The number to get the absolute value of |
Notes
- Removes the sign from a number, making it positive
- Returns NULL if the input is NULL
ABS(0) = 0ABS(positive) = positiveABS(negative) = positive
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