From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:37:00 +0000 (+0100) Subject: [3.12] gh-127852: add remark about ',' separator (GH-127854) (#127942) X-Git-Tag: v3.12.9~150 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d7b5b369a2c05efb033811b25f35d767d87769d;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-127852: add remark about ',' separator (GH-127854) (#127942) Specify that it is valid for floats and ints with 'd' presentation and an error otherwise. --------- (cherry picked from commit e2325c9db0650fc06d909eb2b5930c0573f24f71) Co-authored-by: Sergey B Kirpichev Co-authored-by: Terry Jan Reedy --- diff --git a/Doc/library/string.rst b/Doc/library/string.rst index a000bb49f148..913672a3ff22 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -409,7 +409,9 @@ conversions, trailing zeros are not removed from the result. .. index:: single: , (comma); in string formatting -The ``','`` option signals the use of a comma for a thousands separator. +The ``','`` option signals the use of a comma for a thousands separator for +floating-point presentation types and for integer presentation type ``'d'``. +For other presentation types, this option is an error. For a locale aware separator, use the ``'n'`` integer presentation type instead.