﻿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
1124	"admin interface FloatField validator raise ""TypeError"" when exceeding decimal_places"	emanuele.olivetti@…	Adrian Holovaty	"Unexpected behaviour in admin interface. If I specify a given number of decimal_places in FloatField:
{{{
  ....(snippet from my model)...
  quantita = meta.FloatField(""Quantita"",max_digits=10,decimal_places=2,core=True)
  ....
}}}
and I try to insert more figures than 2 after the dot (e.g. ""1.2345"") , I got a TypeError:
----
{{{
Request Method:  	POST
Request URL: 	http://127.0.0.1:8000/admin/koan/ddt/96/
Exception Type: 	TypeError
Exception Value: 	not all arguments converted during string formatting
Exception Location: 	/usr/local/lib/python2.4/site-packages/django/core/validators.py in __call__, line 354
...
}}}
-----
This happens both for 0.90 and current svn revision.

The validator works correctly if I try to insert something different than a float number (e.g. ""a"" -> ""Please correct the error below.""), but fails, raising TypeError, when exceeding decimal_places. Which is definitely unexpected.

Emanuele

"	defect	closed	contrib.admin		normal	worksforme			Unreviewed	0	0	0	0	0	0
