bpo-45708: Support underscore separators when formatting Decimal objects by mdickinson · Pull Request #29438 · python/cpython
Conversation
This PR extends formatting for Decimal objects to support underscores as thousands separators (as described in PEP 515). Previously, Decimal only supported commas as thousands separators, while int and float support both commas and underscores.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
I looks almost identical to what I did 🙂
This will break tests [...]
Darn. Thanks, @tiran - my instincts were telling me that we shouldn't modify libmpdec directly, but I failed to figure out why it was a problem.
Closing here; let's continue discussion on the issue.
Re-opening as a proof-of-concept draft PR to show one possible way that we could take this forward without touching libmpdec.
belm0
mentioned this pull request
Closing. This has served its purpose as a POC. I'm not likely to have time to turn it into a production-quality PR any time soon.
mdickinson
deleted the
support-underscore-in-decimal-format
branch
sndrtj
mannequin
mentioned this pull request