#15789: floatformat filter works incorrectly when decimal precision is set low
----------------------+--------------------------------
Reporter: akaihola | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Template system
Version: SVN | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 |
----------------------+--------------------------------
When `floatformat` receives a decimal places argument which is equal or
larger than the current decimal precision, the decimal part isn't
truncated. An example:
{{{
>>> from django.template.defaultfilters import floatformat
>>> import decimal
>>> decimal.getcontext().prec = 2
>>> floatformat(1.23456789123, 1)
u'1.2'
>>> floatformat(1.23456789123, 2)
u'1.23456789123'
>>> floatformat(1.23456789123, 3)
u'1.23456789123'
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15789>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.