L
Lie Ryan
"e" is already used, "n" is already used, "g" is already used, etcMark said:I am considering writing a PEP for the inclusion of an engineering
format specifier, and would appreciate input from others.[...]
I am thinking that if we simply added something like %n (for eNgineer)
to the list of format specifiers that we could make life easier for
engineers:
("%n" % 12345) == "12.345e+03"
("%n" % 1234) == "1.234e+03"
("%n" % 123) == "123e+00"
("%n" % 1.2345e-5) == "12.345e+06"
I don't think there's much chance of getting changes to old-style
string formatting accepted; you might be better off aiming at the new-
style string formatting. (And there, the 'n' modifier is already
taken for internationalization, so you'd have to find something
different.
"t" for "powers of a thousand", perhaps? (Or "m"?)
or perhaps as an extension to 'e', activated by '3e' (but that's
occupied for adding spaces, need to think of another way...)