Fixed #2789 -- Corrected typo from r3788.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3796 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d8b84cac91
commit
aa30761d51
|
@ -356,7 +356,7 @@ class IsValidFloat(object):
|
||||||
if len(data) > max_allowed_length:
|
if len(data) > max_allowed_length:
|
||||||
raise ValidationError, ngettext("Please enter a valid decimal number with at most %s total digit.",
|
raise ValidationError, ngettext("Please enter a valid decimal number with at most %s total digit.",
|
||||||
"Please enter a valid decimal number with at most %s total digits.", self.max_digits) % self.max_digits
|
"Please enter a valid decimal number with at most %s total digits.", self.max_digits) % self.max_digits
|
||||||
if (not '.' in data and len(data) > (self.max_allowed_length - self.decimal_places)) or ('.' in data and len(data) > (self.max_digits - (self.decimal_places - len(data.split('.')[1])) + 1)):
|
if (not '.' in data and len(data) > (max_allowed_length - self.decimal_places)) or ('.' in data and len(data) > (self.max_digits - (self.decimal_places - len(data.split('.')[1])) + 1)):
|
||||||
raise ValidationError, ngettext( "Please enter a valid decimal number with a whole part of at most %s digit.",
|
raise ValidationError, ngettext( "Please enter a valid decimal number with a whole part of at most %s digit.",
|
||||||
"Please enter a valid decimal number with a whole part of at most %s digits.", str(self.max_digits-self.decimal_places)) % str(self.max_digits-self.decimal_places)
|
"Please enter a valid decimal number with a whole part of at most %s digits.", str(self.max_digits-self.decimal_places)) % str(self.max_digits-self.decimal_places)
|
||||||
if '.' in data and len(data.split('.')[1]) > self.decimal_places:
|
if '.' in data and len(data.split('.')[1]) > self.decimal_places:
|
||||||
|
|
Loading…
Reference in New Issue