Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Doubt on Trunc Function

DevguyApr 27 2011 — edited Apr 27 2011
Hey all,Can someone clear my doubt on trunc..here is the example
SQL> select trunc(45.923,2) from dual;

TRUNC(45.923,2)
===============
	  45.92

SQL> select trunc(12345.5432,2) from dual;

TRUNC(12345.5432,2)
===================
	      12346
In the first example oracle truncates the number to 2 decimal places so the value is 45.92..But,whereas in the second one it should do the same..The result should resemble 12345.54...But,oracle gives me *12346*..
Can someone explain me the reason why it does like that

Thanks in advance!!
This post has been answered by Ganesh Srivatsav on Apr 27 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2011
Added on Apr 27 2011
9 comments
470 views