          if isinstance(data, six.text_type) and len(data) > self.MAX_STRING_LENGTH:
              self.fail('max_string_length')
  
          try:
              data = int(data)
          except (ValueError, TypeError):
              self.fail('invalid')
          return data
  
      def to_representation(self, value):
 
</s> remove         0.0: 0
 </s> add         0.0: 0,
        '1.0': 1 </s> remove         'abc': ['A valid integer is required.']
 </s> add         0.5: ['A valid integer is required.'],
        'abc': ['A valid integer is required.'],
        '0.5': ['A valid integer is required.']
            data = int(re.compile(r'\.0*\s*$').sub('', str(data)))
          if isinstance(data, six.text_type) and len(data) > self.MAX_STRING_LENGTH:
              self.fail('max_string_length')
  
          try:
            data = int(re.compile(r'\.0*\s*$').sub('', str(data)))
          except (ValueError, TypeError):
              self.fail('invalid')
          return data
  
      def to_representation(self, value):
keep keep keep keep replace keep keep keep keep keep
 Match IntegerField validation with Django's, preventing decimal values being stored as ints, fixes #2835.

Match IntegerField validation with Django IntegerField, prevents decimal values being stored as ints, fixes #2835
 On branch master 
rest_framework/fields.py