﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2917	[PATCH] Admin list display doesn't properly display FloatFields	heckj@…	Adrian Holovaty	"In version 0.95 and through trunk on SVN, the admin interface by default doesn't properly display values stored in FloatFields.

The resulting access to the admin page with a FloatField results in the traceback:

If you use a FloatField in the admin list_display, you get an error
rendering the template from line 160 in admin_list.py (TypeError, float
argument required)

158.            elif isinstance(f, models.FloatField):
159.                if field_val is not None:
160.                    result_repr = ('%%.%sf' % f.decimal_places) %
field_val
161.                else:
162.                    result_repr = EMPTY_CHANGELIST_VALUE 

Back in April, Dave A recorded a possible fix on the django-user's mailing list, but I wasn't ever able to find a bug about it, or a patch - so I'm supplying it based on what he suggested. It works nicely, and resolves the internal display issue. He asserted:

I think the line should be:

160.                    result_repr = ('%%.%df' % f.decimal_places) % float(field_val) 


"	defect	closed	contrib.admin	dev	major	fixed			Unreviewed	0	0	0	0	0	0
