﻿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
33232	DecimalField rounding error when upgrading from 3.1 to 3.2 on Postgres	Michał Szczepańczyk	nobody	"Example:

{{{
from django.db import models

class Foo(models.Model):
    amount = models.DecimalField(decimal_places=2, max_digits=12)

from myapp.models import Foo
f = Foo(amount='1.125')
f.save()
f.refresh_from_db()

# the issue is here
f.amount  # returns Decimal('1.12') in 3.1 and Decimal('1.13') in 3.2
}}}

Executed query for 3.2:
{{{
INSERT INTO ""myapp_foo"" (""amount"") VALUES (1.125) RETURNING ""myapp_foo"".""id""
}}}

Executed query for 3.1:
{{{
INSERT INTO ""myapp_foo"" (""amount"") VALUES ('1.12') RETURNING ""myapp_foo"".""id""
}}}


Issue was reproduced only when using postgres database."	Bug	closed	Database layer (models, ORM)	3.2	Normal	invalid	decimal, decimalfield, rounding, postgres	Simon Charette	Unreviewed	0	0	0	0	0	0
