TRUNC
Description
Converts a float to a number based on the decimal places that you specify.
Syntax
TRUNC(
value
, [
num_digits
])
- value: The number to truncate.
- num_digits: The number of decimal places to truncate to. Specify 0 to truncate to the closest integer. A positive num_digits specifies the number of digits to the right of the decimal point. A negative num_digits specifies the number of digits to the left of the decimal point. If you omit the argument, the function uses the value 0, which causes the function to truncate to the closest integer.
Example
Formula | Result |
|---|---|
=TRUNC(12.34) | 12 |
=TRUNC(-12.34) | -12 |
=TRUNC(12.34,-1) | 10 |
=TRUNC(-12.34,-1) | -10 |