Opened 13 years ago
Closed 13 years ago
#17779 closed Bug (invalid)
floatformat template filter no longer works at all
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Release blocker | Keywords: | floatformat templatetag |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
As of a recent commit, the floatformat template filter no longer works at all:
>>> from django.template.defaultfilters import floatformat >>> import decimal >>> floatformat(decimal.Decimal('12.345'), 2) u'12.345' >>> floatformat(12.345, 2) u'12.345' >>> floatformat(12.345, 5) u'12.345' >>> floatformat(12.345, -2) u'12.345'
Change History (2)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
I traced the problem to a build of Python that was incapable of doing proper math with the Decimal class; the bug is not in Django. Apologies for the noise.
Note:
See TracTickets
for help on using tickets.
The input value is simply returned due to this exception occurring when floatformat tries to quantize the Decimal instance:
This exception is caught at the end of the floatformat function and input_val is returned.