]> granicus.if.org Git - python/commitdiff
Merged revisions 79833 via svnmerge from
authorEric Smith <eric@trueblade.com>
Tue, 6 Apr 2010 15:21:59 +0000 (15:21 +0000)
committerEric Smith <eric@trueblade.com>
Tue, 6 Apr 2010 15:21:59 +0000 (15:21 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79833 | eric.smith | 2010-04-06 11:17:33 -0400 (Tue, 06 Apr 2010) | 1 line

  Note that PEP 378 also applies to int.
........

Doc/whatsnew/2.7.rst

index fa041907f4b01f27ff3b89bf61a9755f8f64cf8b..329518dc6df3c3a8756a7458db0b0af6ff46b771 100644 (file)
@@ -210,6 +210,11 @@ width and the precision::
    >>> '{:20,.2f}'.format(18446744073709551616.0)
    '18,446,744,073,709,551,616.00'
 
+When formatting an integer, include the comma after the width:
+
+   >>> '{:20,d}'.format(18446744073709551616)
+   '18,446,744,073,709,551,616'
+
 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`