[issue34311] locale.format() and locale.format_string() cast Decimals to float

Eric V. Smith report at bugs.python.org
Wed Aug 1 20:40:06 EDT 2018


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

Would my suggestion in #33731 of adding another letter in the format spec for float and decimal.Decimal solve your problem? I guess if you're using monetary=True you'd need two additional letters: like 'f' but locale aware, and like 'f' but locale aware and monetary=True.  Maybe 'l' and 'L' for these? In this case, there would be no changes to the locale module.

I don't see any good way of using new-style formatting without changing float.__format__ and decimal.Decimal.__format__.

----------
components: +Interpreter Core
type:  -> enhancement
versions:  -Python 3.6, Python 3.7

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


More information about the Python-bugs-list mailing list