Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 274d9ab

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

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎Doc/library/string.rst

Copy file name to clipboardExpand all lines: Doc/library/string.rst
+5-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.