TRUNC Function
Returns a number truncated to the specified number of digits.
TRUNC(number, numberofdigits )
Name | Required/Optional | Data Type | Description |
---|---|---|---|
number |
Required |
Numeric |
The number to truncate. |
numberofdigits |
Required |
Numeric |
The number of digits to which to truncate number. |
Numeric.
If numberofdigits is greater than 0, number is truncated to numberofdigits to the right of the decimal. If numberofdigits is 0, number is truncated to an integer. If numberofdigits is less than 0, number is truncated to numberofdigits to the left of the decimal.
TRUNC(123.654,2)
Returns 123.65.
TRUNC(123.654,0)
Returns 123.
TRUNC(123.654,-1)
Returns 120.