diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2014-07-22 20:55:51 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2014-07-22 20:55:51 +0200 |
| commit | f8161b78728615c6c67a70985935ff7798921578 (patch) | |
| tree | e2e90889ba2ab4ece2531bf612fb7e97204c3d75 /budget/models.py | |
| parent | 229fe41a0ceb207e8d6d4b24adfa0aa2c32b436d (diff) | |
| parent | 79f24b7cb812f0fa0aa1b4bb82d23cbae87d540e (diff) | |
| download | ihatemoney-mirror-f8161b78728615c6c67a70985935ff7798921578.zip ihatemoney-mirror-f8161b78728615c6c67a70985935ff7798921578.tar.gz ihatemoney-mirror-f8161b78728615c6c67a70985935ff7798921578.tar.bz2 | |
Merge pull request #117 from aavenel/fix-rounding
Fix #116 : rounding error in balances
Diffstat (limited to 'budget/models.py')
| -rw-r--r-- | budget/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/budget/models.py b/budget/models.py index c1372c0..55a97c1 100644 --- a/budget/models.py +++ b/budget/models.py @@ -45,7 +45,7 @@ class Project(db.Model): for person in self.members: balance = should_receive[person] - should_pay[person] - balances[person.id] = round(balance, 2) + balances[person.id] = balance return balances @@ -219,7 +219,7 @@ class Bill(db.Model): def pay_each(self): """Compute what each person has to pay""" if self.owers: - return round(self.amount / len(self.owers), 2) + return self.amount / len(self.owers) else: return 0 |
