diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-09-26 12:40:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-26 12:40:18 (GMT) |
commit | 274d9ab619b8150a613275835234ea9ef935f21f (patch) | |
tree | eb3a2ac4f5d0f2d3327d48f625bf74d9335207a6 /Doc | |
parent | 19fed6cf6eb51044fd0c02c6338259e2dd7fd462 (diff) | |
download | cpython-274d9ab619b8150a613275835234ea9ef935f21f.zip cpython-274d9ab619b8150a613275835234ea9ef935f21f.tar.gz cpython-274d9ab619b8150a613275835234ea9ef935f21f.tar.bz2 |
gh-123560: Correct docs for "empty" format type for floats (#123561)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/string.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 1f31630..57a1f92 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -574,11 +574,13 @@ The available presentation types for :class:`float` and | ``'%'`` | Percentage. Multiplies the number by 100 and displays | | | 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 | | | result, it always includes at least one digit past the | - | | decimal point. The precision used is as large as needed | - | | to represent the given value faithfully. | + | | decimal point, and switches to the scientific notation | + | | 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 | | | either ``'g'`` or ``'G'`` depending on the value of | |