Commit 1660a61a authored by Brennan D Baraban's avatar Brennan D Baraban Committed by Julien Palard

bpo-23460: Fix documentation for decimal string :g formatting (GH-11850)

parent 1a53c785
......@@ -500,9 +500,10 @@ 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 |
| | precision ``p-1`` would have exponent ``exp``. Then, |
| | 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 |
......
The documentation for decimal string formatting using the `:g` specifier has been updated to reflect the correct exponential notation cutoff point. Original patch contributed by Tuomas Suutari.
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment