A simple problem but I can't get documentation about this kind of format: I want to print a float in a Fortran scientific notation, with its integer part always being zero.
printf("%0.5E",data); // Gives 2.74600E+02
I want to print it like this:
.27460E+03
How can I get this result as clean as possible?
I tried doing this with
log10()andpow(), but ended up having problems with rounding errors. So as commented by @Karoly Horvath, string manipulation is probably the best approach.