Spread 8.0 Documentation
TRUNC
Support Options
Formula Reference > Built-In Functions > TRUNC

Glossary Item Box

TRUNC


Name

Truncate

Description

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.

See also CEILING, EVEN, FLOOR, INT, ODD, ROUND, ROUNDDOWN, and ROUNDUP.

Data Type

Accepts numeric data for both arguments. Returns numeric data. For more information, see Data Type for Each Cell Type.

Example

TRUNC(5.745)=5
TRUNC(-5.745)=-5
TRUNC(5.745,2)=5.74
TRUNC(PI())=3

Copyright © GrapeCity, inc. All rights reserved.