| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -629,6 +629,20 @@ | |
| of the :func:`round` builtin. For :class:`~decimal.Decimal`, the rounding | ||
| mode of the current :ref:`context <decimal-context>` will be used. | ||
|
|
||
|
|
||
| .. note:: | ||
|
|
||
| The :class:`~decimal.Decimal` type has special formatting behavior: | ||
|
|
||
| * When using ``__format__`` (f-strings, ``format()``, ``str.format()``), | ||
| Decimal formats with maximum precision only when precision is **omitted** | ||
|
Comment thread
Comment on lines
+637
to
+638
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis is already documented, please revert. Also, the whole section of documentation is about string formatting, it's pointless to say that you are using __format__().
Sorry, something went wrong.
All reactions
|
||
| in ``f``, ``e``, or ``g`` format types. If precision is explicitly specified, | ||
| it is respected. | ||
|
|
||
| * When using ``%`` formatting (old-style string formatting with the ``%`` operator), | ||
| Decimal values are first converted to :class:`float`, which may result in | ||
|
Comment thread
Comment on lines
+642
to
+643
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Sorry, something went wrong.
All reactions
|
||
| precision loss. | ||
|
|
||
| The available presentation types for :class:`complex` are the same as those for | ||
| :class:`float` (``'%'`` is not allowed). Both the real and imaginary components | ||
| of a complex number are formatted as floating-point numbers, according to the | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityChanges in Doc/c-api/ are not related to this pr, please revert.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.