Engineering numerical format PEP discussion

Keith keith.brafford at gmail.com
Tue Apr 27 02:36:31 CEST 2010


>Apparently either you and the General Decimal Arithmetic spec differ
>on what constitutes engineering notation, there's a bug in the Python
>decimal library,

You've distilled it precisely, and as you've shown in a different
post, it's the former.

The Python decimal module seems to implement correctly Mike
Cowlishaw's spec, but what that spec refers to as "engineering
notation" isn't really what engineers actually use.  That is, even
with decimal.Decimal.to_eng_string(), engineers still end up having to
write their own string formatting code.

I think it's worth making the print statement (or print function, as
the case may be) let us do engineering notation, just like it lets us
specify scientific notation.

--Keith Brafford



More information about the Python-list mailing list