I can’t see if it is possible to control the format of the e part beyond E or e, i.e., how to set the number of digits after the e or whether you can force the sign to appear (which perhaps isn’t valid anyway).
There are at least 3 motivations to format a float into a string:
having a developper-facing output for debug purposes (Debug trait)
having the smallest possible String to be used in an ASCII serialization aimed at being consumed by other softwares (CSV, JSON, …)
having a user-facing output, i.e. an ASCII serialization aimed at being visualized (showing, e.g., well-aligned table rows)
In the two first cases, the 1.24e2 output is perfectly valid.
In the last case, the best compromise in order to keep the format syntax complexity low
is probably the C choice, i.e. exponent of width 3 (f32) or 4 (f64) starting with the sign and possibly followed by leading zeros.
The reason simply being that the range of exponent values for a f32 is [-38, +38] and [-308, +308] for a f64.
This assumes that the data will be displayed in columns. I would assert that “d = 2.5e+001 meters, t = 1e-001 seconds” is less easy for human reading than “d = 25 meters, t = 0.1 seconds”. The optimal formatting is far less simple than you are making it out to be.
In many cases the scientific notation is among the worst possible, since the most significant digits are placed at the opposite ends of a possibly very long string. Aligned decimal places can be way more clear, but of course add their own set of limitations.
Printing human readable tabular data is a very common task (at least in my biased experience).
I agree, but this post is focused on the exponent part of the scientific notation (assuming we already made the choice of the scientific notation), which is probably not the best choice in your example.
It depends on the range of possible values of the variable one want to print.
For example, if a scientist is used to a physical quantity possibly ranging (in his field/in the particular context of his code) from 1e-10 to 1e-15, he will probably choose %e instead of %f (neglecting here possible flags, width, precision, … to possibly align, suppress physically insignificant digits, …).
I don’t think it is a problem since we know that human reading is not linear. The eyes will probably jump to the exponent part (it is easier with a well aligned pattern, including signs), before reading the mantissa part.