diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 3278cf51c..d5071a1aa 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1135,11 +1135,12 @@ class DecimalField(Field): return value context = decimal.getcontext().copy() + rounding = context.rounding if self.rounding is None else self.rounding if self.max_digits is not None: context.prec = self.max_digits return value.quantize( decimal.Decimal('.1') ** self.decimal_places, - rounding=self.rounding, + rounding=rounding, context=context )