[issue41250] Number separators in different places

Eric V. Smith report at bugs.python.org
Thu Jul 9 02:29:06 EDT 2020


Eric V. Smith <eric at trueblade.com> added the comment:

The formatting specification language is already complicated enough without adding even more to it. As PEP 378 says "It is not the goal to replace the locale module, to perform internationalization tasks, or accommodate every possible convention."

Your best bet is to write your own formater and use that:

f'{formater(v)}'

You could also pass it whatever parameters you want, like specifying the number of digits or the separator or whether to use the locale to determine these things.

The PEP suggests Babel (http://babel.pocoo.org/en/latest/), which I don't have any experience with, but seems pretty complete.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41250>
_______________________________________


More information about the Python-bugs-list mailing list