diff --git a/InvenTree/InvenTree/fields.py b/InvenTree/InvenTree/fields.py index b3393ef1eb..7dbf953016 100644 --- a/InvenTree/InvenTree/fields.py +++ b/InvenTree/InvenTree/fields.py @@ -43,7 +43,16 @@ def round_decimal(value, places): class RoundingDecimalFormField(forms.DecimalField): def to_python(self, value): value = super(RoundingDecimalFormField, self).to_python(value) - return round_decimal(value, self.decimal_places) + value = round_decimal(value, self.decimal_places) + return value + + def prepare_value(self, value): + """ + Override the 'prepare_value' method, to remove trailing zeros when displaying. + Why? It looks nice! + """ + + return value.normalize() class RoundingDecimalField(models.DecimalField):