Roy Smith <[EMAIL PROTECTED]> wrote:

> In article <[EMAIL PROTECTED]>,
>  "Dustan" <[EMAIL PROTECTED]> wrote:
> 
> > 1000000000000000000000000000000000000000000000000000
> 
> >>> print "%e" % 1000000000000000000000000000000000000000000000000000
> 1.000000e+51

Exactly: the "%e" builds a ``scientific-notation" string from whatever
number you're formatting that way (big or small).  You can also use %g
if what you want is fixed-point notation within a certain range and
scientific notations only for numbers OUTSIDE that range, as in:

>>> print '%g' % 10**5
100000
>>> print '%g' % 10**50
1e+50


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to