The code : [ float f = 10.123; printf("%10.4E\n",f); ] results (Microsoft Visual C++) : 1.0123E+001 How to print 1.0123E+01 ? (2 digits after E instead of 3) Best regards, Peter
The code : [ float f = 10.123; printf("%10.4E\n",f); ] results (Microsoft Visual C++) : 1.0123E+001 How to print 1.0123E+01 ? (2 digits after E instead of 3) Best regards, Peter
It seems to me that you can't get 2 digits instead of 3. But you can print to string using sprintf() instead of printf(), find unnecessary '0' character and remove it.