Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(158777)

Unified Diff: Doc/library/decimal.rst

Issue 23460: Decimals do not obey ':g' exponential notation formatting rules
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Doc/library/string.rst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
index 7052985..b491bcf 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -862,6 +862,14 @@ Decimal objects
:const:`Rounded`. If given, applies *rounding*; otherwise, uses the
rounding method in either the supplied *context* or the current context.
+ .. method:: __format__(format)
+
+ Format as string using the given ``format``.
+
+ This makes it possible to specify format string for a :class:`Decimal`
+ object when using :meth:`str.format`. For a complete list of formatting
+ directives, see :ref:`formatspec`.
+
.. _logical_operands_label:
« no previous file with comments | « no previous file | Doc/library/string.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+