Formatting Decimal with digits >=16
We use locale\.format\(\) to format the Decimal \(and float\) with the formatter \'\%\.\*f\'\. The problem is that internally Python convert the Decimal into float and than format it\. So we have a loose of precision which can have bad result\. E\.g\: \
\
\>\>\> locale\.format\(\'\%\.\*f\'\, \(16\, Decimal\(\'1\.15\'\)\)\) \
\'1\.1499999999999999\' \
\
This was reported on https\:\/\/bugs\.python\.org\/#34311 \
And I made a proposal https\:\/\/github\.com\/python\/cpython\/pull\/15275 to add a new method locale\.localize\(\) in the stdlib\. \
\
I propose to monkey patch locale to include this method and to use it\.
issue