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!

Conversion function

934101Nov 13 2014 — edited Nov 13 2014

Hi All, I have few values like below, I want to convert them into two decimal places. First four conditions are achievable using to char function. However when case is 5 i.e. (.9 ) its shows as .90, (.09) is shown as .09, but I need .9 as 0.90 and .09 as 0.09. Kindly requesting you to assist. 9        > 9.00 90      > 90.00 900    > 900.00 9000  > 9000.00 .9      > 0.09 .09    > 0.09 SELECT  TO_CHAR(.9, '99999999.99'),         TO_CHAR(.09, '99999999.99'),         TO_CHAR(90, '99999999.99'),         TO_CHAR(9000, '99999999.99') FROM dual

This post has been answered by 2810868 on Nov 13 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2014
Added on Nov 13 2014
11 comments
2,676 views