summaryrefslogtreecommitdiffstats
path: root/Doc/library/string.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-07-12 20:47:13 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-07-12 20:47:13 (GMT)
commit868aa06b669f7eb209ceaa8c964fe089aa939f68 (patch)
tree54908724646d817a22e30d38ce2c316c8ad7d5d2 /Doc/library/string.rst
parent41fe28220bf2790277f9a82446c73736709378c6 (diff)
downloadcpython-868aa06b669f7eb209ceaa8c964fe089aa939f68.zip
cpython-868aa06b669f7eb209ceaa8c964fe089aa939f68.tar.gz
cpython-868aa06b669f7eb209ceaa8c964fe089aa939f68.tar.bz2
Document the thousands separator.
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r--Doc/library/string.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 861dd1f..215e76d 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -300,7 +300,7 @@ result as if you had called :func:`str` on the value.
The general form of a *standard format specifier* is:
.. productionlist:: sf
- format_spec: [[`fill`]`align`][`sign`][#][0][`width`][.`precision`][`type`]
+ format_spec: [[`fill`]`align`][`sign`][#][0][`width`][,][.`precision`][`type`]
fill: <a character other than '}'>
align: "<" | ">" | "=" | "^"
sign: "+" | "-" | " "
@@ -358,6 +358,10 @@ The ``'#'`` option is only valid for integers, and only for binary, octal, or
hexadecimal output. If present, it specifies that the output will be prefixed
by ``'0b'``, ``'0o'``, or ``'0x'``, respectively.
+The ``','`` option signals the use of a comma for a thousands separator.
+For a locale aware separator, use the ``'n'`` integer presentation type
+instead.
+
*width* is a decimal integer defining the minimum field width. If not
specified, then the field width will be determined by the content.