Skip to content

Commit 274d9ab

Browse files
authored
gh-123560: Correct docs for "empty" format type for floats (#123561)
1 parent 19fed6c commit 274d9ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/library/string.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,13 @@ The available presentation types for :class:`float` and
574574
| ``'%'`` | Percentage. Multiplies the number by 100 and displays |
575575
| | in fixed (``'f'``) format, followed by a percent sign. |
576576
+---------+----------------------------------------------------------+
577-
| None | For :class:`float` this is the same as ``'g'``, except |
577+
| None | For :class:`float` this is like the ``'g'`` type, except |
578578
| | that when fixed-point notation is used to format the |
579579
| | result, it always includes at least one digit past the |
580-
| | decimal point. The precision used is as large as needed |
581-
| | to represent the given value faithfully. |
580+
| | decimal point, and switches to the scientific notation |
581+
| | when ``exp >= p - 1``. When the precision is not |
582+
| | specified, the latter will be as large as needed to |
583+
| | represent the given value faithfully. |
582584
| | |
583585
| | For :class:`~decimal.Decimal`, this is the same as |
584586
| | either ``'g'`` or ``'G'`` depending on the value of |

0 commit comments

Comments
 (0)