﻿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
31841	DecimalField doesnt't respect max_digits when converting	Thiago Bellini Ribeiro	nobody	"A field defined like this:

{{{
foo = models.DecimalField(max_digits=20, decimal_places=6)
}}}

When trying to set a float 0.2 it would give an error regarding the maximum decimal places. That because the context that converts the float to decimal only respect max_digits:

{{{
In [1]: import decimal                                                                                                                                                                                                                        

In [2]: c = decimal.Context(prec=20)                                                                                                                                                                                                          

In [3]: c.create_decimal_from_float(0.2)                                                                                                                                                                                                      
Out[3]: Decimal('0.20000000000000001110')
}}}

For floats django should probably round the value to the decimal_places defined in the field."	Bug	closed	Database layer (models, ORM)	3.0	Normal	duplicate			Unreviewed	1	0	0	0	0	0
