Engineering numerical format PEP discussion
contact at xavierho.com
Mon Apr 26 07:54:00 CEST 2010
On Mon, Apr 26, 2010 at 3:39 PM, Chris Rebert <clp2 at rebertia.com> wrote:
> "The conversion **exactly follows the rules for conversion to
> scientific numeric string** except in the case of finite numbers
> **where exponential notation is used.**"
Well, then maybe the conversion doesn't exactly follow the rules, in this
> The description of to-scientific-string explains exactly when it uses
> exponential notation, but it gets slightly technical and I'm not
> interested enough, nor do I have the time at the moment, to read the
> entire spec.
I understand. Emphasise mine, here: (so you don't have to read the entire
if the number is non-zero, the converted exponent is adjusted to be a
multiple of three (engineering notation) by positioning the decimal point
with one, two, or three characters preceding it* (that is, the part before
the decimal point will range from 1 through 999);
*Perhaps this module could use some improvement. It is already very, very
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list