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!

Number formatting issue

702934May 22 2009 — edited May 22 2009
Hi all,

My requirement is to display the number in below format.
If it is 123456.67 , it should be displayed as 123,456.67
If it is 123456 , it should be displayed as 123,456 only.

I tried the below options:

select to_char('123456.67','999,999,999,990.99') from dual;
123,456.67

select to_char('123456','999,999,999,990') from dual;
123,457

Is there any way of handling both the scenarios, in a single query ?

Thanks in Advance.

Agathya
This post has been answered by Hoek on May 22 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2009
Added on May 22 2009
8 comments
871 views