Engineering numerical format PEP discussion

Keith keith.brafford at
Mon Apr 26 00:42:42 EDT 2010

On Apr 26, 12:02 am, Chris Rebert <c... at> wrote:
> On Sun, Apr 25, 2010 at 8:36 PM, Keith <keith.braff... at> wrote:
> > I am considering writing a PEP for the inclusion of an engineering
> > format specifier, and would appreciate input from others.
> Relevant related information:
> The Decimal datatype supports engineering format directly:
> Cheers,
> Chris

Thanks for pointing that out.  Does the engineering community get by
with the decimal module?

Even though this uses the to_eng_string() function, and even though I
am using the decimal.Context class:

>>> c = decimal.Context(prec=5)
>>> decimal.Decimal(1234567).to_eng_string(c)

That is not an engineering notation string.

--Keith Brafford

More information about the Python-list mailing list