      def to_representation(self, value):
          if not isinstance(value, decimal.Decimal):
              value = decimal.Decimal(six.text_type(value).strip())
  
          context = decimal.getcontext().copy()
          context.prec = self.max_digits
          quantized = value.quantize(
              decimal.Decimal('.1') ** self.decimal_places,
              context=context
          )
          if not self.coerce_to_string:
              return quantized
          return '{0:f}'.format(quantized)
  
  
 
</s> remove         Validates that the input is a decimal number. Returns a Decimal
        instance. Returns None for empty values. Ensures that there are no more
        than max_digits in the number, and no more than decimal_places digits
        after the decimal point.
 </s> add         Validate that the input is a decimal number and return a Decimal
        instance.
        quantized = self.quantize(value)

      def to_representation(self, value):
          if not isinstance(value, decimal.Decimal):
              value = decimal.Decimal(six.text_type(value).strip())
  
        quantized = self.quantize(value)

        quantized = self.quantize(value)

        quantized = self.quantize(value)

        quantized = self.quantize(value)

        quantized = self.quantize(value)

        quantized = self.quantize(value)

          if not self.coerce_to_string:
              return quantized
          return '{0:f}'.format(quantized)
  
  
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Refactored DecimalField to allow easier subclassing 
rest_framework/fields.py