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!

to_char number formatting

763900Nov 29 2010 — edited Nov 29 2010
Hello,

Could anybody please help me?

How do I turn a number of varying length into a format with n decimal places, and comma separators indicating thousands?

Googling tells me that if I have a number of known length, eg 1099.68794 that I can achieve this by using the following syntax (for 2 dp):
select to_char(1099.68794,'9,999.99') from dual
output 1,099.68

I want to apply this format to numbers of varying length though, so should I have a much longer number, say 46456237272372672.782378237823782, I also want this to have the same format, could anybody please tell me the syntax? I'm not managing to find it in my oracle book or by googing thus far.

output 46,456,237,272,372,672.78

Thank you,

Jon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2010
Added on Nov 29 2010
5 comments
3,641 views