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

Unified Diff: Doc/library/string.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 | « Doc/library/decimal.rst ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
index f9da5fa..ca167c9 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -451,8 +451,9 @@ The available presentation types for floating point and decimal values are:
| | The precise rules are as follows: suppose that the |
| | result formatted with presentation type ``'e'`` and |
| | precision ``p-1`` would have exponent ``exp``. Then |
- | | if ``-4 <= exp < p``, the number is formatted |
- | | with presentation type ``'f'`` and precision |
+ | | if ``m <= exp < p`` where ``m`` is -4 for floats and -6 |
+ | | for :class:`Decimals <decimal.Decimal>`, the number is |
+ | | formatted with presentation type ``'f'`` and precision |
| | ``p-1-exp``. Otherwise, the number is formatted |
| | with presentation type ``'e'`` and precision ``p-1``. |
| | In both cases insignificant trailing zeros are removed |
« no previous file with comments | « Doc/library/decimal.rst ('k') | no next file » | no next file with comments »

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