TRUNC
Returns the rounded absolute value of a numeric value. The returned value will always be rounded to less than the original value.
Syntax
TRUNC(<val>[, <dec>])
Parameter | Description |
---|---|
<val> | Valid values include column names, functions that return a column with numeric values, and constant numeric values. |
<dec> | Optional. An INT constant that defines the decimal range of the returned value. By default, TRUNC returns whole numbers. |
Example
SELECT
TRUNC(-20.5);
Returns: -20
SELECT
TRUNC(-99.999999, 3);
Returns: -99.999