Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-99880: document rounding mode for new-style formatting #121481

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ The available presentation types for :class:`float` and
| | as altered by the other format modifiers. |
+---------+----------------------------------------------------------+

The result should be correctly rounded to a given precision ``p`` of digits
after the decimal point. For :class:`float`, used rounding mode match the one
for :func:`round` builtin, i.e. it should round results midway between
skirpichev marked this conversation as resolved.
Show resolved Hide resolved
representable values toward the nearest value with an even (0) least
significant bit. For :class:`~decimal.Decimal`, rounding mode of the current
:ref:`context <decimal-context>` is used.
skirpichev marked this conversation as resolved.
Show resolved Hide resolved


.. _formatexamples:

Expand Down
Loading