diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-10-14 04:44:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 04:44:48 (GMT) |
commit | cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c (patch) | |
tree | 1835ee0442d71572658dc5e0c49fc6e8758bf2ec /Doc/library/string.rst | |
parent | f1d33dbddd3496b062e1fbe024fb6d7b023a35f5 (diff) | |
download | cpython-cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c.zip cpython-cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c.tar.gz cpython-cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c.tar.bz2 |
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r-- | Doc/library/string.rst | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 57a1f92..49aeb28 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -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. | @@ -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``. | |