Opened 6 years ago

Last modified 5 years ago

#29823 closed Cleanup/optimization

Incorrect Decimal handling in Sum queries — at Initial Version

Reported by: Jurica Železnjak Owned by: nobody
Component: Documentation Version: 2.1
Severity: Normal Keywords:
Cc: Sergey Fedoseev Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When doing Sum aggregate or annotate query on a DecimalField the result is a close-to-zero float (scientific notation) when it should be zero.

For example: 8 records, with following values: 7.85, -7, 19.85, -7, -5, -7, -0.85, -0.85
Aggregate Sum query on this column should equal Decimal('0.00'), but I'm getting Decimal('1.77635683940025E-15')

Before Django 2.1.0 this worked properly.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top