This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The format of Scientific notification

For the printf command, the default format of the E argument is:
« - »d.ddddE« - »dd

eg. 1.234E-05

In my case i dont need the leading zero in the exponent.

I want the output like this:
1.234E-5

Can i change the printf output with any argument?
Do i have to make my own printf function?
Or can i change the compilers printf command?

Parents
  • Maybe not the answer you're looking for, but...

    Couldn't you simply post process the output of the printf to remove the offending '0' character before using the string...? Seems to me like that might the simplest way around your problem.

    Just a thought...

    Dave.

Reply
  • Maybe not the answer you're looking for, but...

    Couldn't you simply post process the output of the printf to remove the offending '0' character before using the string...? Seems to me like that might the simplest way around your problem.

    Just a thought...

    Dave.

Children