Proposal:
Enable this
>>> format(12_34_56.12_34_56, '_._f')
'123_456.123_456'
Where now only this is possible
>>> format(12_34_56.12_34_56, '_.f')
'123_456.123456'
Based on the discussion in the Ideas forum, three core devs support this addition.
https://discuss.python.org/t/add-underscore-as-a-thousandths-separator-for-string-formatting/7407
I'm willing to give this a try if someone points me to where to add tests and where the float formatting code is. This would be my first CPython contribution.
The feature freeze for 3.10 is 2021-05-03.
https://www.python.org/dev/peps/pep-0619/#id5 |