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!

Formatting a number with 2 decimals

TinaAug 20 2020 — edited Aug 21 2020

HI Gurus,

  I am trying to format a number to display 2 decimals including for zeros (0.00)

  and I am using FM9990 for that.

  I have a confusion on the difference between FM9999.00 vs FM9990.00?

  Also this will work only for 4 digit numbers..if I have number greater than that I need to increase it accordingly.

  Can't we just use higher range like 9999999999.00 , so that we don't have any issue with length of number.

   SELECT TO_CHAR(1101,'FM9999.00'),

       TO_CHAR(1101,'FM9990.00'),

       TO_CHAR(0,'FM9999.00'),

       TO_CHAR(0,'FM9990.00')

FROM DUAL;

Thanks

This post has been answered by Paulzip on Aug 21 2020
Jump to Answer
Comments
Post Details
Added on Aug 20 2020
9 comments
24,180 views