﻿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
27907	DecimalFields don't work with initial	Steven L Smith	nobody	"
Consider a simple form with a DecimalField:


{{{
class PatronLevelForm(forms.Form):
	name = forms.CharField()
	lower_threshold = forms.DecimalField(max_digits=20, decimal_places=2)
}}}


In a view, set up some initial data:

{{{
form = PatronLevelForm(initial={'name': 'Valued Donor', 'lower_threshold': Decimal(0.01),},)
}}}


The Decimal gets cast to float and request.POST ends up looking like this:


{{{
<QueryDict: {u'name': [u'Valued Donor'], u'lower_threshold': [u'0.01000000000000000020816681711721685132943093776702880859375']}>
}}}
"	Bug	closed	Forms	1.10	Normal	invalid			Unreviewed	0	0	0	0	0	0
