﻿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
28797	"Sum aggregation might return ""-0.00"" instead of ""0.00"""	Simon Hanna	nobody	"I have an application with the following Model:

{{{
class Split(models.Model):
  amount = models.DecimalField(max_digits=10, decimal_places=2)
}}}

And perform the following query:
{{{
Split.objects.filter(...).aggregate(models.Sum('amount'))['amount__sum'] or 0
}}}

which returns the mentioned ""-0.00"" for specific filters. I'm not sure why that happens.
A values_list for an example where it happens is here:
{{{
[29.63, -30.0, 155.5, -156.45, -0.08, 400.0, -400.0, 440.0, -463.98, -10.0, -700.0, 735.0, -14.83, -150.0, 0.08, -9.5, -2.34, -62.82, -500.0, 735.0, -300.0, -500.0, 490.0, -170.6, -10.0, -300.0, -0.11, 735.0, 300.0, -239.5]
}}}

The whole code is part of https://github.com/agstrike/silverstrike with the query in https://github.com/agstrike/silverstrike/blob/master/silverstrike/models.py#L54

If you point me at the right direction I might be able to debug a little"	Bug	closed	Database layer (models, ORM)	1.11	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
