]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed PEP 378 example.
authorEric Smith <eric@trueblade.com>
Tue, 6 Apr 2010 14:30:15 +0000 (14:30 +0000)
committerEric Smith <eric@trueblade.com>
Tue, 6 Apr 2010 14:30:15 +0000 (14:30 +0000)
Doc/whatsnew/2.7.rst

index 8a46ff44fda1c6232ef286292545265c89a3e6ee..e18db48ef692dc98462ae305cfbce04909699196 100644 (file)
@@ -215,14 +215,9 @@ mini-language used by the :meth:`str.format` method.  When
 formatting a floating-point number, simply include a comma between the
 width and the precision::
 
-   >>> '{:20,.2}'.format(f)
+   >>> '{:20,.2f}'.format(18446744073709551616.0)
    '18,446,744,073,709,551,616.00'
 
-.. XXX this example seems wrong:
-.. >>> f = 18446744073709551616.0
-.. >>> '{:20,.2}'.format(f)
-.. '             1.8e+19'
-
 This mechanism is not adaptable at all; commas are always used as the
 separator and the grouping is always into three-digit groups.  The
 comma-formatting mechanism isn't as general as the :mod:`locale`