From 36a6df3dc663ff805f8888a08a30de080d532fd7 Mon Sep 17 00:00:00 2001 From: Brennan D Baraban <375@holbertonschool.com> Date: Wed, 13 Feb 2019 22:55:21 -0800 Subject: [PATCH 1/2] bpo-23460: Properly document decimal string formatting for :g exponential notation specifier Co-authored-by: Tuomas Suutari --- Doc/library/string.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 46b2bfc82b738b..99e5a8c641c97d 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -501,9 +501,10 @@ The available presentation types for floating point and decimal values are: | | | | | The precise rules are as follows: suppose that the | | | result formatted with presentation type ``'e'`` and | - | | precision ``p-1`` would have exponent ``exp``. Then | - | | if ``-4 <= exp < p``, the number is formatted | - | | with presentation type ``'f'`` and precision | + | | precision ``p-1`` would have exponent ``exp``. Then, | + | | if ``m <= exp < p``, where ``m`` is -4 for floats and -6 | + | | for :class:`Decimals `, the number is | + | | formatted with presentation type ``'f'`` and precision | | | ``p-1-exp``. Otherwise, the number is formatted | | | with presentation type ``'e'`` and precision ``p-1``. | | | In both cases insignificant trailing zeros are removed | From d9e4186559cebc4282f114521e35b907d3c804ec Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" Date: Thu, 14 Feb 2019 07:12:48 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Documentation/2019-02-14-07-12-48.bpo-23460.Iqiqtm.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2019-02-14-07-12-48.bpo-23460.Iqiqtm.rst diff --git a/Misc/NEWS.d/next/Documentation/2019-02-14-07-12-48.bpo-23460.Iqiqtm.rst b/Misc/NEWS.d/next/Documentation/2019-02-14-07-12-48.bpo-23460.Iqiqtm.rst new file mode 100644 index 00000000000000..4674d551d37976 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-02-14-07-12-48.bpo-23460.Iqiqtm.rst @@ -0,0 +1 @@ +The documentation for decimal string formatting using the `:g` specifier has been updated to reflect the correct exponential notation cutoff point. Original patch contributed by Tuomas Suutari. \ No newline at end of file