[issue23460] Decimals do not obey ':g' exponential notation formatting rules
Sept. 2, 2018
8:02 a.m.
Lorenz Mende <lorenz.mende@gmail.com> added the comment: 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. ---------- nosy: +LorenzMende _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue23460> _______________________________________
2348
Age (days ago)
2348
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lorenz Mende