[Django] #34272: floatformat throws an error in some edge cases

3 views
Skip to first unread message

Django

unread,
Jan 18, 2023, 11:16:57 AM1/18/23
to django-...@googlegroups.com
#34272: floatformat throws an error in some edge cases
-------------------------------------------+------------------------
Reporter: andriilahuta | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
{{{#!python
from decimal import Decimal
from django.template.defaultfilters import floatformat

floatformat('0.00', 0)
floatformat(Decimal('0.00'), 0)
}}}
Both throw {{{ValueError: valid range for prec is [1, MAX_PREC]}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34272>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages