floatformat() crashes on "0.00".
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]
Change History
(6)
Cc: |
ziima added
|
Severity: |
Normal → Release blocker
|
Summary: |
floatformat throws an error in some edge cases → floatformat() crashes on "0.00".
|
Triage Stage: |
Unreviewed → Accepted
|
Cc: |
David Wobrock added
|
Has patch: |
set
|
Owner: |
changed from nobody to David Wobrock
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Thanks for the report and testing against the alpha release!
Regression in 08c5a787262c1ae57f6517d4574b54a5fcaad124.
#34098