Parameter List
Syntax
TRUNC(number,
[num_digits]
)number
The number to truncate. For example: 123.456
, -87.92
, or A1
.
[optional] num_digits
The number of decimal places to keep:
Positive number - Truncate to that many decimal places
0
(default) - Truncate to integer (no decimal places)Negative number - Truncate to the left of decimal point
More details
TRUNC removes digits by cutting them off rather than rounding. For positive num_digits, it truncates to that many decimal places. For negative num_digits, it truncates to the left of the decimal point (e.g., -1 truncates to the nearest 10, -2 to the nearest 100). When num_digits is 0 or omitted, it removes all decimal places, returning an integer.