This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients GiftZwergrapper, eric.smith, lemburg
Date 2020-10-26.18:58:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1603738725.22.0.24586376652.issue42156@roundup.psfhosted.org>
In-reply-to
Content
And just to show that python is doing the right thing, if the locale is set up correctly, I'll show the following hack:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'en_US')
'en_US'
>>> locale.currency(24.99)
'$24.99'
>>> locale._override_localeconv["p_cs_precedes"] = 0
>>> locale.currency(24.99)
'24.99$'

Notice the change from '$24.99' to '24.99$' when I change p_cs_precedes to 0.

WARNING: you really, really shouldn't use _override_localeconv. It looks like it exists just for testing, but I'm using it here to show that currency formatting does respect p_cs_precedes.

On the other hand, I've often wanted to build up a locale programmatically and then use it, so maybe we should support that use case.
History
Date User Action Args
2020-10-26 18:58:45eric.smithsetrecipients: + eric.smith, lemburg, GiftZwergrapper
2020-10-26 18:58:45eric.smithsetmessageid: <1603738725.22.0.24586376652.issue42156@roundup.psfhosted.org>
2020-10-26 18:58:45eric.smithlinkissue42156 messages
2020-10-26 18:58:45eric.smithcreate