[Python-checkins] r70337 - peps/trunk/pep-0378.txt

raymond.hettinger python-checkins at python.org
Fri Mar 13 00:33:12 CET 2009


Author: raymond.hettinger
Date: Fri Mar 13 00:33:12 2009
New Revision: 70337

Log:
Clarify what width means when thousands separators are present.

Modified:
   peps/trunk/pep-0378.txt

Modified: peps/trunk/pep-0378.txt
==============================================================================
--- peps/trunk/pep-0378.txt	(original)
+++ peps/trunk/pep-0378.txt	Fri Mar 13 00:33:12 2009
@@ -112,6 +112,12 @@
 
   format(n, "6,f").replace(",", "X").replace(".", ",").replace("X", ".")
 
+The *width* argument means the total length including the commas
+and decimal point::
+
+  format(1234, "08,d")     -->    '0001,234'
+  format(1234.5, "08,.1f") -->    '01,234.5'
+
 
 Proposal II (to meet Antoine Pitrou's request)
 ==============================================
@@ -138,6 +144,9 @@
 __format__ methods that follow the format specification
 mini-language.
 
+As shown in the examples, the *width* argument means the total
+length including the thousands separators and decimal separators.
+
 No change is proposed for the locale module.
 
 


More information about the Python-checkins mailing list