Skip to content

Commit

Permalink
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhiy Storchaka <[email protected]>
  • Loading branch information
skirpichev and serhiy-storchaka authored Oct 14, 2024
1 parent f1d33db commit cfc27bc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand All @@ -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``. |
Expand Down

0 comments on commit cfc27bc

Please sign in to comment.