From 799b7e4136910664d3c5ee050e1005dcf700f0e6 Mon Sep 17 00:00:00 2001 From: bchhabra2490 Date: Sat, 28 Apr 2018 14:37:32 +0530 Subject: [PATCH 1/2] bpo-32790: Added info about alt format using # for 'g' --- Doc/library/string.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index ee8ea857da4b96..369345097e74af 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -483,6 +483,11 @@ The available presentation types for floating point and decimal values are: | | from the significand, and the decimal point is also | | | removed if there are no remaining digits following it. | | | | + | | Also, The ``'#'`` option causes the "alternate form" to | + | | be used for the conversion. The alternate form is defined| + | | differently for different types. For ``'g'`` conversion, | + | | trailing zeros are not removed from the result. | + | | | | | Positive and negative infinity, positive and negative | | | zero, and nans, are formatted as ``inf``, ``-inf``, | | | ``0``, ``-0`` and ``nan`` respectively, regardless of | From 45aa15d31e37ed89d1389b1798cd1ac73f40207e Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Fri, 13 Sep 2019 18:59:50 +0200 Subject: [PATCH 2/2] Shorter version. --- Doc/library/string.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 369345097e74af..673223171ce7d9 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -481,12 +481,8 @@ The available presentation types for floating point and decimal values are: | | with presentation type ``'e'`` and precision ``p-1``. | | | In both cases insignificant trailing zeros are removed | | | from the significand, and the decimal point is also | - | | removed if there are no remaining digits following it. | - | | | - | | Also, The ``'#'`` option causes the "alternate form" to | - | | be used for the conversion. The alternate form is defined| - | | differently for different types. For ``'g'`` conversion, | - | | trailing zeros are not removed from the result. | + | | removed if there are no remaining digits following it, | + | | unless the ``'#'`` option is used. | | | | | | Positive and negative infinity, positive and negative | | | zero, and nans, are formatted as ``inf``, ``-inf``, |