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!

Format number without converting to char?

PleiadianJan 11 2011 — edited Jan 11 2011
Hi,

I would like to control the amount of digits of a numeric field in my query results. The query returns real numbers with varying precision.

Of course, you can use to_char(), but that converts all numbers to strings and the result will be left aligned.

Using the round function is also not sufficient, because it will not display trailing zeros, e.g. round(0.120,3) results in 0.12

Is it possible to format a number in another way?

Thanks!

Rob
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2011
Added on Jan 11 2011
9 comments
2,416 views