gh-123560: Correct docs for "empty" format type for floats (#123561)

This commit is contained in:
Sergey B Kirpichev 2024-09-26 15:40:18 +03:00 committed by GitHub
parent 19fed6cf6e
commit 274d9ab619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -574,11 +574,13 @@ The available presentation types for :class:`float` and
| ``'%'`` | Percentage. Multiplies the number by 100 and displays | | ``'%'`` | Percentage. Multiplies the number by 100 and displays |
| | in fixed (``'f'``) format, followed by a percent sign. | | | in fixed (``'f'``) format, followed by a percent sign. |
+---------+----------------------------------------------------------+ +---------+----------------------------------------------------------+
| None | For :class:`float` this is the same as ``'g'``, except | | None | For :class:`float` this is like the ``'g'`` type, except |
| | that when fixed-point notation is used to format the | | | that when fixed-point notation is used to format the |
| | result, it always includes at least one digit past the | | | result, it always includes at least one digit past the |
| | decimal point. The precision used is as large as needed | | | decimal point, and switches to the scientific notation |
| | to represent the given value faithfully. | | | when ``exp >= p - 1``. When the precision is not |
| | specified, the latter will be as large as needed to |
| | represent the given value faithfully. |
| | | | | |
| | For :class:`~decimal.Decimal`, this is the same as | | | For :class:`~decimal.Decimal`, this is the same as |
| | either ``'g'`` or ``'G'`` depending on the value of | | | either ``'g'`` or ``'G'`` depending on the value of |