* cc: Josh Schneier (added)
* component: Forms => Core (Other)
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. We should fix an edge case with `0`, maybe:
{{{#!diff
diff --git a/django/core/validators.py b/django/core/validators.py
index 473203a67e..446f97af10 100644
--- a/django/core/validators.py
+++ b/django/core/validators.py
@@ -487,7 +487,9 @@ class DecimalValidator:
)
if exponent >= 0:
# A positive exponent adds that many trailing zeros.
- digits = len(digit_tuple) + exponent
+ digits = len(digit_tuple)
+ if digit_tuple != (0,):
+ digits += exponent
decimals = 0
else:
# If the absolute value of the negative exponent is larger
than the
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34014#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.