]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
authorSergey B Kirpichev <skirpichev@gmail.com>
Mon, 14 Oct 2024 04:44:48 +0000 (07:44 +0300)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2024 04:44:48 +0000 (21:44 -0700)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/string.rst

index 57a1f920523035377b7b237d1995ffde756d9bf6..49aeb28d57c8d17042bae70c0ec6ca6751fe1904 100644 (file)
@@ -509,9 +509,8 @@ The available presentation types for :class:`float` and
    |         | significant digits. With no precision given, uses a      |
    |         | precision of ``6`` digits after the decimal point for    |
    |         | :class:`float`, and shows all coefficient digits         |
-   |         | for :class:`~decimal.Decimal`. If no digits follow the   |
-   |         | decimal point, the decimal point is also removed unless  |
-   |         | the ``#`` option is used.                                |
+   |         | for :class:`~decimal.Decimal`.  If ``p=0``, the decimal  |
+   |         | point is omitted unless the ``#`` option is used.        |
    +---------+----------------------------------------------------------+
    | ``'E'`` | Scientific notation. Same as ``'e'`` except it uses      |
    |         | an upper case 'E' as the separator character.            |
@@ -522,9 +521,8 @@ The available presentation types for :class:`float` and
    |         | precision given, uses a precision of ``6`` digits after  |
    |         | the decimal point for :class:`float`, and uses a         |
    |         | precision large enough to show all coefficient digits    |
-   |         | for :class:`~decimal.Decimal`. If no digits follow the   |
-   |         | decimal point, the decimal point is also removed unless  |
-   |         | the ``#`` option is used.                                |
+   |         | for :class:`~decimal.Decimal`.  If ``p=0``, the decimal  |
+   |         | point is omitted unless the ``#`` option is used.        |
    +---------+----------------------------------------------------------+
    | ``'F'`` | Fixed-point notation. Same as ``'f'``, but converts      |
    |         | ``nan`` to  ``NAN`` and ``inf`` to ``INF``.              |