Ticket #4485: decimalfield_null.diff

File decimalfield_null.diff, 546 bytes (added by sime <simon@…>, 8 years ago)

as described

  • django/db/models/fields/__init__.py

     
    610610        if value < 0:
    611611            num_chars += 1
    612612
    613         return "%.*f" % (self.decimal_places, value)
     613        if value is None:
     614            return ''
     615        else:
     616            return "%.*f" % (self.decimal_places, value)
    614617
    615618    def get_db_prep_save(self, value):
    616619        if value is not None:
Back to Top