Message324473
| Author |
LorenzMende |
| Recipients |
LorenzMende, docs@python, ezio.melotti, ikelly, mark.dickinson, skrah, tuomas.suutari |
| Date |
2018年09月02日.08:02:23 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1535875344.18.0.56676864532.issue23460@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I want to bring this issue up again.
As the others correctly stated, either the documentation or the implementation of Decimal 'g' formatting is incorrect.
For floats the implementation suits the docu:
>>> '{:g}'.format(0.00001)
'1e-05'
For decimals:
>>> '{:g}'.format(decimal.Decimal('0.00001'))
'0.00001'
As there is a deviation between documentation and implementation, I advise to modify one of both. |
|