Skip to Main Content

Oracle Database Discussions

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 numbers

TinaSep 11 2019 — edited Sep 11 2019

Hi Gurus,

I am trying to format a number where I have to add comma after 3 digit and $ in the front.

I have some confusion here.

   SELECT TO_CHAR(-1000, '$9,999.00') FROM DUAL;

  -$1,000.00 , this works fine

SELECT TO_CHAR(-10000, '$9,999.00') FROM DUAL;

This doesn't work and number is 5 digit before decimal where as format model is expecting 4.

Do we need to know the length of number when we use these format models?

The number I am suming can be of any length and I have no idea how long these sum can be.

This post has been answered by GregV on Sep 11 2019
Jump to Answer
Comments
Post Details
Added on Sep 11 2019
8 comments
360 views