Django: Ticket Queryhttps://code.djangoproject.com/query?status=!closed&keywords=~localization&order=priority
The Web framework for perfectionists with deadlines.en-USDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/query?status=!closed&keywords=~localization&order=priority
Trac 1.0.7https://code.djangoproject.com/ticket/14317
https://code.djangoproject.com/ticket/14317#14317: numberformat.format produces wrong resultsMon, 20 Sep 2010 19:45:13 GMTakaariai<p>
The problem:
</p>
<pre class="wiki">&gt;&gt;&gt; from django.utils.numberformat import format
&gt;&gt;&gt; print format(0.000000001, ',', 2)
1e-10,2
</pre><p>
It can be fixed with using '%.2f' % number (the format string can be constructed dynamically), and then replacing the decimal separator and doing the grouping if needed. As a bonus, it is faster that way.
</p>
Resultshttps://code.djangoproject.com/ticket/14317#changelog