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!

How to round to 16 significant figures?

BoneistOct 31 2008 — edited Nov 1 2008
My google/forum-fu is failing me today, and I'm hoping that someone might be able to suggest something.

Basically, I've got to transform values passed in in one currency to another by dividing by an fx rate. This bit, I can handle, but the data coming in is in 16 significant figures, and my output also needs to be in 16 s.f. format.

So, assuming I've got data in the following format:
with my_tab as (select 22673.333550957921 num from dual union all
                select 0.0000000038002838659797923 from dual union all
                select 123456789012345678 from dual)
select * 
from   my_tab
what would be the most efficient way of rounding to 16 significant figures? Obviously, if it were 16 decimal places, that would be easy, I'd just use the ROUND function...

Edited by: Boneist on Oct 31, 2008 3:35 PM
editted the first number in my example so it's at 17 sf, rolls eyes
This post has been answered by Frank Kulash on Oct 31 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2008
Added on Oct 31 2008
16 comments
998 views