diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2009-10-05 22:42:56 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2009-10-05 22:42:56 (GMT) |
commit | fa6a4271c11ef8b62312b448b0053d694f05d95f (patch) | |
tree | 0e8583c0c4962f480d5da7889f526e6725743b48 | |
parent | b6f0128c632fa6621cfdc384ddafd6cb38219bf0 (diff) | |
download | cpython-fa6a4271c11ef8b62312b448b0053d694f05d95f.zip cpython-fa6a4271c11ef8b62312b448b0053d694f05d95f.tar.gz cpython-fa6a4271c11ef8b62312b448b0053d694f05d95f.tar.bz2 |
Backport r73983: Document the thousands separator.
-rw-r--r-- | Doc/library/string.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 9a13dc6..f5a1a3e 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -325,7 +325,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: "+" | "-" | " " @@ -383,6 +383,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. |