[Python-checkins] r79826 - python/trunk/Doc/whatsnew/2.7.rst
eric.smith
python-checkins at python.org
Tue Apr 6 16:30:15 CEST 2010
Author: eric.smith
Date: Tue Apr 6 16:30:15 2010
New Revision: 79826
Log:
Fixed PEP 378 example.
Modified:
python/trunk/Doc/whatsnew/2.7.rst
Modified: python/trunk/Doc/whatsnew/2.7.rst
==============================================================================
--- python/trunk/Doc/whatsnew/2.7.rst (original)
+++ python/trunk/Doc/whatsnew/2.7.rst Tue Apr 6 16:30:15 2010
@@ -215,14 +215,9 @@
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`
More information about the Python-checkins
mailing list