From: Eric Smith Date: Tue, 6 Apr 2010 15:17:33 +0000 (+0000) Subject: Note that PEP 378 also applies to int. X-Git-Tag: v2.7b1~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a92860a3ed4a6deaef31d641c4a91a4b396ee2d;p=thirdparty%2FPython%2Fcpython.git Note that PEP 378 also applies to int. --- diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index e18db48ef692..e0e4e0fda941 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -218,6 +218,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`