Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference TRUNCATE
Functions and Expressions Reference Guide
214
TRUNCATE
The TRUNCATE function removes decimal places from a number, leaving a
specified number of decimal places.
Syntax
TRUNCATE (single-number-expression[ , single-integer-
expression ] )
Meaning
TRUNCATE (number_to_truncate[ , number_of_decimal_places ] )
Returns
This function returns a single-number.
TRUNCATE first converts number_to_truncate to character format, if necessary.
It then truncates that number by removing decimal places to the right of
number_of_decimal_places. If number_of_decimal_places is not used, the
number is truncated to an integer.
Example
TRUNCATE ( 3.9292 , 2 ) returns 3.92
TRUNCATE ( 3.9292 ) returns 3
Uses
Use
TRUNCATE with a second argument to truncate a number to a specified
number of decimal places. Use
TRUNCATE without a second argument to
reduce a number to an integer by removing all decimal places.
Related Functions
INT, ROUND