=ROUND or =TRUNC ?


Posted by Chris D on January 24, 2002 12:43 PM

Hi all,

If A1 contains 100.25

What's the difference between =round(A1,2) and =trunc(A1,0) ?

many thanks
Chris

Posted by Juan Pablo G. on January 24, 2002 12:45 PM

I'm assuming you meant ROUND(A1,0). And in your case, nothing but if you have 100.75, Round will return 101, and Trunc will return 100.

Juan Pablo G.

Posted by Chris D on January 24, 2002 12:56 PM

Yep, typo, I meant =ROUND(A1,0).

No difference then ? just a different approach ?

thanks
Chris

Posted by Juan Pablo G. on January 24, 2002 12:57 PM

Depends, again, on your numbers. TRUNC will eliminate all decimals without even looking at them. So, 100.2 and 100.7 will be 100.

ROUND, however, will "see" the decimals. So, 100.2 will be 100 BUT 100.7 will be 101.

Juan Pablo G.



Posted by Chris D on January 24, 2002 1:03 PM

Ahh, thanks, yes I see....

100.99 with round is 101

100.99 with trunc is still 100

thanks
:-)