Kaydet (Commit) fa6a4271 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Backport r73983: Document the thousands separator.

üst b6f0128c
...@@ -325,7 +325,7 @@ result as if you had called :func:`str` on the value. ...@@ -325,7 +325,7 @@ result as if you had called :func:`str` on the value.
The general form of a *standard format specifier* is: The general form of a *standard format specifier* is:
.. productionlist:: sf .. 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 '}'> fill: <a character other than '}'>
align: "<" | ">" | "=" | "^" align: "<" | ">" | "=" | "^"
sign: "+" | "-" | " " sign: "+" | "-" | " "
...@@ -383,6 +383,10 @@ The ``'#'`` option is only valid for integers, and only for binary, octal, or ...@@ -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 hexadecimal output. If present, it specifies that the output will be prefixed
by ``'0b'``, ``'0o'``, or ``'0x'``, respectively. 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 *width* is a decimal integer defining the minimum field width. If not
specified, then the field width will be determined by the content. specified, then the field width will be determined by the content.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment