Skip to content

Commit 1279be6

Browse files
miss-islingtonskirpichevserhiy-storchaka
authored
[3.13] gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426) (#125428)
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426) (cherry picked from commit cfc27bc) Co-authored-by: Sergey B Kirpichev <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 98655ce commit 1279be6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Doc/library/string.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,8 @@ The available presentation types for :class:`float` and
509509
| | significant digits. With no precision given, uses a |
510510
| | precision of ``6`` digits after the decimal point for |
511511
| | :class:`float`, and shows all coefficient digits |
512-
| | for :class:`~decimal.Decimal`. If no digits follow the |
513-
| | decimal point, the decimal point is also removed unless |
514-
| | the ``#`` option is used. |
512+
| | for :class:`~decimal.Decimal`. If ``p=0``, the decimal |
513+
| | point is omitted unless the ``#`` option is used. |
515514
+---------+----------------------------------------------------------+
516515
| ``'E'`` | Scientific notation. Same as ``'e'`` except it uses |
517516
| | an upper case 'E' as the separator character. |
@@ -522,9 +521,8 @@ The available presentation types for :class:`float` and
522521
| | precision given, uses a precision of ``6`` digits after |
523522
| | the decimal point for :class:`float`, and uses a |
524523
| | precision large enough to show all coefficient digits |
525-
| | for :class:`~decimal.Decimal`. If no digits follow the |
526-
| | decimal point, the decimal point is also removed unless |
527-
| | the ``#`` option is used. |
524+
| | for :class:`~decimal.Decimal`. If ``p=0``, the decimal |
525+
| | point is omitted unless the ``#`` option is used. |
528526
+---------+----------------------------------------------------------+
529527
| ``'F'`` | Fixed-point notation. Same as ``'f'``, but converts |
530528
| | ``nan`` to ``NAN`` and ``inf`` to ``INF``. |

0 commit comments

Comments
 (0)