Skip to content

Commit

Permalink
[3.12] pythongh-123133: clarify p=0 case for "f" and "e" formatting t…
Browse files Browse the repository at this point in the history
…ypes (pythonGH-125426) (python#125429)

pythongh-123133: clarify p=0 case for "f" and "e" formatting types (pythonGH-125426)
(cherry picked from commit cfc27bc)

Co-authored-by: Sergey B Kirpichev <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
  • Loading branch information
3 people authored Oct 14, 2024
1 parent f49221a commit 20323bf
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 20323bf

Please sign in to comment.