Truncate (TRUNC)

Syntax: TRUNC(x; y)

The TRUNC function is different from other rounding functions. It does not round number x, but chops off its fractional part, leaving y digits after the decimal point (if the second argument is omitted, TRUNC chops off the whole fractional part of a number turning it into an integer). For example:

=TRUNC(12.5)

returns 12. The subtle difference between TRUNC and INT is best explained when you use the same negative number as an argument for these functions; for example:

=TRUNC(-15.72)

returns –15, while

=INT(-15.72)

returns –16.

In this example TRUNC is used with a second argument and

=TRUNC(16.2371; 2)

returns 16.23.

Figure 6-10. Sample results of the TRUNC function

See also the sections on the ...

Get Beginning OpenOffice Calc: From Setting Up Simple Spreadsheets to Business Forecasting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.