Ticket #2917: admin_float_field.diff

File admin_float_field.diff, 770 bytes (added by heckj@…, 18 years ago)

Patch file for admin list display

  • django/contrib/admin/templatetags/admin_list.py

     
    152152            # FloatFields are special: Zero-pad the decimals.
    153153            elif isinstance(f, models.FloatField):
    154154                if field_val is not None:
    155                     result_repr = ('%%.%sf' % f.decimal_places) % field_val
     155                    result_repr = ('%%.%sf' % f.decimal_places) % float(field_val)
    156156                else:
    157157                    result_repr = EMPTY_CHANGELIST_VALUE
    158158            # Fields with choices are special: Use the representation
Back to Top