string formatting: engineering notation

Darren Dale dd55 at cornell.edu
Wed Mar 14 16:14:15 EDT 2007


Does anyone know if it is possible to represent a number as a string with
engineering notation (like scientific notation, but with 10 raised to
multiples of 3: 120e3, 12e-6, etc.). I know this is possible with the
decimal.Decimal class, but repeatedly instantiating Decimals is inefficient
for my application (matplotlib plotting library). If it is not currently
possible, do you think the python devs would be receptive to including
support for engineering notation in future releases?

Thanks,
Darren



More information about the Python-list mailing list