TRUNC (Primitive Spread Function) removes the specified fractional part of the specified number.
SYNTAX:
TRUNC(number,digits)
REMARKS:
Use the number argument as the number you want to truncate. Set the digits argument to the number indicating the precision of the truncation. If you do not specify a value for the digits argument, the function assumes 0.
Set digits to a value greater than zero to truncate to the specified number of decimal places. Set digits to zero to truncate to the nearest whole number. Set digits to a value less than zero to round the value left of the decimal to the nearest ten, hundred, etc.
The TRUNC and INT functions are similar in that both can return integers. Use the TRUNC function to remove the decimal portion of the number; the TRUNC function does not round up or down. Use the INT function to round numbers down to the nearest integer based decimal portion of the number.
The INT and TRUNC functions differ also when using negative numbers: TRUNC(-4.2, 0) returns –4, but INT(-4.2) returns –5 because –5 is the lower number.
Note: The setting of the TypeCurrencyDecPlaces, TypeNumberDecPlaces, and TypePercentDecPlaces properties can affect the display of the truncated number. Be sure to set the properties such that the entire number can be displayed, if that is your intended effect.
EXAMPLES:
TRUNC(5.745)=5
TRUNC(-5.745)=-5
TRUNC(5.745,2)=5.74
TRUNC(PI())=3