printf format for double

  • Thread starter Joachim Schmitz
  • Start date
J

Joachim Schmitz

Is it possible to print a float or double in exponential form with a 0
before the decimal point?

E.g. 0.1234567E+00 rather than 1.2345670E-01 (using %14.7E) ? As far as I
understand the format specifies in n1256, this isn't possible, is it?

Bye, Jojo
 
B

Ben Pfaff

Joachim Schmitz said:
Is it possible to print a float or double in exponential form with a 0
before the decimal point?

No, there is no way to convince printf to do that. You could
post-process sprintf's output into that format, though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top