Index: django/core/validators.py
===================================================================
--- django/core/validators.py	(revision 5616)
+++ django/core/validators.py	(working copy)
@@ -26,7 +26,7 @@
     r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
     r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string
     r')@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}$', re.IGNORECASE)  # domain
-decimal_re = re.compile(r'^-?(?P<digits>\d+)(\.(?P<decimals>\d+))?$')
+decimal_re = re.compile(r'^-?(?P<digits>\d*)(\.(?P<decimals>\d+))?$')
 integer_re = re.compile(r'^-?\d+$')
 ip4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
@@ -418,10 +418,10 @@
         match = decimal_re.search(str(field_data))
         if not match:
             raise ValidationError, _("Please enter a valid decimal number.")
-        
-        digits = len(match.group('digits') or '')
-        decimals = len(match.group('decimals') or '')
-        
+
+        digits = len((match.group('digits') or '').lstrip('0'))
+        decimals = len((match.group('decimals') or '').rstrip('0'))
+
         if digits + decimals > self.max_digits:
             raise ValidationError, ungettext("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
Index: django/newforms/fields.py
===================================================================
--- django/newforms/fields.py	(revision 5616)
+++ django/newforms/fields.py	(working copy)
@@ -162,7 +162,7 @@
             raise ValidationError(ugettext('Ensure this value is greater than or equal to %s.') % self.min_value)
         return value
 
-decimal_re = re.compile(r'^-?(?P<digits>\d+)(\.(?P<decimals>\d+))?$')
+decimal_re = re.compile(r'-?(?P<digits>\d*)(\.(?P<decimals>\d+))?$')
 
 class DecimalField(Field):
     def __init__(self, max_value=None, min_value=None, max_digits=None, decimal_places=None, *args, **kwargs):
@@ -181,17 +181,18 @@
         if not self.required and value in EMPTY_VALUES:
             return None
         value = value.strip()
-        match = decimal_re.search(value)
+        match = decimal_re.match(value)
         if not match:
             raise ValidationError(ugettext('Enter a number.'))
-        else:
-            value = Decimal(value)
-        digits = len(match.group('digits') or '')
-        decimals = len(match.group('decimals') or '')
+
+        value = Decimal(value.rstrip('0'))
         if self.max_value is not None and value > self.max_value:
             raise ValidationError(ugettext('Ensure this value is less than or equal to %s.') % self.max_value)
         if self.min_value is not None and value < self.min_value:
             raise ValidationError(ugettext('Ensure this value is greater than or equal to %s.') % self.min_value)
+
+        digits = len((match.group('digits') or '').lstrip('0'))
+        decimals = len((match.group('decimals') or '').rstrip('0'))
         if self.max_digits is not None and (digits + decimals) > self.max_digits:
             raise ValidationError(ugettext('Ensure that there are no more than %s digits in total.') % self.max_digits)
         if self.decimal_places is not None and decimals > self.decimal_places:
Index: tests/regressiontests/forms/tests.py
===================================================================
--- tests/regressiontests/forms/tests.py	(revision 5616)
+++ tests/regressiontests/forms/tests.py	(working copy)
@@ -1132,11 +1132,11 @@
 ...
 ValidationError: [u'Enter a number.']
 >>> f.clean('1.0 ')
-Decimal("1.0")
+Decimal("1")
 >>> f.clean(' 1.0')
-Decimal("1.0")
+Decimal("1")
 >>> f.clean(' 1.0 ')
-Decimal("1.0")
+Decimal("1")
 >>> f.clean('1.0a')
 Traceback (most recent call last):
 ...
@@ -1177,6 +1177,13 @@
 >>> f.clean('0.5')
 Decimal("0.5")
 
+DecimalField works with values which trim down to max_digits and decimal_places
+>>> f = DecimalField(max_digits=4, decimal_places=4)
+>>> f.clean('.1234')
+Decimal("0.1234")
+>>> f.clean('00000.12340')
+Decimal("0.1234")
+
 # DateField ###################################################################
 
 >>> import datetime
