Ticket #7064: fix-decimal-validation.diff
File fix-decimal-validation.diff, 547 bytes (added by , 16 years ago) |
---|
-
django/core/validators.py
437 437 raise ValidationError, _("Please enter a valid decimal number.") 438 438 439 439 pieces = str(val).lstrip("-").split('.') 440 if pieces[0] == '0' and ((len(pieces) == 2) and len(pieces[1])): 441 pieces[0] = '' 440 442 decimals = (len(pieces) == 2) and len(pieces[1]) or 0 441 443 digits = len(pieces[0]) 442 444