Eric V. Smith <e...@trueblade.com> added the comment:

For completeness, here's the output using just format, which I prefer over 
str.format because there's less going on: it removes all of the str.format 
machinery and basically directly calls obj.__format__.

>>> format(1504, '.3g')
'1.5e+03'
>>> format(1505, '.3g')
'1.50e+03'
>>> format(1506, '.3g')
'1.51e+03'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to