diff --git a/django/forms/fields.py b/django/forms/fields.py index 17c7956b53..daa65d61eb 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -343,9 +343,8 @@ class DecimalField(IntegerField): return None if self.localize: value = formats.sanitize_separators(value) - value = str(value).strip() try: - value = Decimal(value) + value = Decimal(str(value)) except DecimalException: raise ValidationError(self.error_messages['invalid'], code='invalid') return value