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 jemerton
Recipients jemerton
Date 2018-08-01.20:22:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533154971.69.0.56676864532.issue34311@psf.upfronthosting.co.za>
In-reply-to
Content
We use locale.format('%.2f', x, True) to convert Decimal values to strings for display. Unfortunately, the locale module is using %-formatting to generate the initial string before applying locale specific formatting. As a result, any value which cannot be accurately represented as a float will produce incorrect results.

I've built some formatting that uses new-style string formatting (and some internal locale functions) which corrects the problem.

Unfortunately, making this change in the locale module would require converting the input format string to the new syntax, so '%.2f' would become '{:.2f}'.

See also #33731
History
Date User Action Args
2018-08-01 20:22:51jemertonsetrecipients: + jemerton
2018-08-01 20:22:51jemertonsetmessageid: <1533154971.69.0.56676864532.issue34311@psf.upfronthosting.co.za>
2018-08-01 20:22:51jemertonlinkissue34311 messages
2018-08-01 20:22:51jemertoncreate