Truncates numbers to a specific digit. You can also use TRUNC to truncate dates.
Syntax
TRUNC( numeric_value [, precision] )
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. Passes the values you want to truncate. You can enter any valid expression that evaluates to a Numeric datatype.
precision
Optional
Can be a positive or negative integer. You can enter any valid expression that evaluates to an integer. The integer specifies the number of digits to truncate.
If precision is a positive integer, TRUNC returns numeric_value with the number of decimal places specified by precision. If precision is a negative integer, TRUNC changes the specified digits to the left of the decimal point to zeros. If you omit the precision argument, TRUNC truncates the decimal portion of numeric_value and returns an integer.
If you pass a decimal precision value, Data Integration rounds numeric_value to the nearest integer before evaluating the expression.
Return Value
Numeric value.
NULL if one of the arguments is NULL.
Example
The following expressions truncate the values in the PRICE column: