      }
      MAX_STRING_LENGTH = 1000  # Guard against malicious string inputs.
  
      def __init__(self, max_digits, decimal_places, coerce_to_string=None, max_value=None, min_value=None,
                   localize=False, **kwargs):
          self.max_digits = max_digits
          self.decimal_places = decimal_places
          self.localize = localize
          if coerce_to_string is not None:
              self.coerce_to_string = coerce_to_string
 
</s> remove # Date & time serializers...
 </s> add class TestRoundingDecimalField(TestCase):
    def test_valid_rounding(self):
        field = serializers.DecimalField(max_digits=4, decimal_places=2, rounding=ROUND_UP)
        assert field.to_representation(Decimal('1.234')) == '1.24'

        field = serializers.DecimalField(max_digits=4, decimal_places=2, rounding=ROUND_DOWN)
        assert field.to_representation(Decimal('1.234')) == '1.23'

    def test_invalid_rounding(self):
        with pytest.raises(AssertionError) as excinfo:
            serializers.DecimalField(max_digits=1, decimal_places=1, rounding='ROUND_UNKNOWN')
        assert 'Invalid rounding option' in str(excinfo.value)
                 localize=False, rounding=None, **kwargs):
      }
      MAX_STRING_LENGTH = 1000  # Guard against malicious string inputs.
  
      def __init__(self, max_digits, decimal_places, coerce_to_string=None, max_value=None, min_value=None,
                 localize=False, rounding=None, **kwargs):
          self.max_digits = max_digits
          self.decimal_places = decimal_places
          self.localize = localize
          if coerce_to_string is not None:
              self.coerce_to_string = coerce_to_string
keep keep keep keep replace keep keep keep keep keep
 Add rounding parameter to DecimalField (#5562)

* Adding rounding parameter to DecimalField.

* Using standard `assert` instead of `self.fail()`.

* add testcase and PEP8 multilines fix

* flake8 fixes

* Use decimal module constants in tests.

* Add docs note for `rounding` parameter. 
rest_framework/fields.py