Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1193
  • Last Modified:

How to format an Oracle null value Number?

Hi,

I have a number as TOTAL(15,4) Oracle.

If it is not null, it will print as:

00000000000.0000

If the TOTAL is null, I would like it to print like:

          0.0000

Leaving 10 empty spaces before the value 0.0000

How do I do that in pl/sql?


Thanks.
_Esam.
0
_Esam
Asked:
_Esam
2 Solutions
 
sdstuberCommented:
NVL(total,lpad('0.0000',15))
0
 
MikeOM_DBACommented:
Try:

Select TO_CHAR(NVL(Total,0),'99999999990.0000') From MyTable;

Open in new window

0
 
gajmpCommented:
SELECT TO_CHAR(NVL(TOTAL, 0),'0000000000.0000') FROM TEST_TAB
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now