You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just came across this library, and even though this question is old I'll answer this in case someone else stumbles across it.
Caveat: Below I give 2 ways to do this using only Python's stdlib. However the locale module is not threadsafe. If you deal with dynamic locales then check out Babel.
Formatting the Money using regular money format
Python's string formatting will handle number grouping:
Keep in mind that if you use the locale.currency method for formatting (or probably any currency helper) then you'd always get a decimal output. This means you would need to use string-formatting and handle locale specifics manually.
Firstly, this is a fantastic library.
I have a few questions relating to readability of the string output:
1000000.00 USD
as1,000,000.00 USD
? (humanize.intcomma
module does this)$1000.00
instead of1000.00 USD
?1000.00 USD -> 1000 USD
?The text was updated successfully, but these errors were encountered: