diff options
Diffstat (limited to 'budget/models.py')
| -rw-r--r-- | budget/models.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/budget/models.py b/budget/models.py index 900b1d0..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 @@ -218,7 +218,10 @@ class Bill(db.Model): def pay_each(self): """Compute what each person has to pay""" - return round(self.amount / len(self.owers), 2) + if self.owers: + return self.amount / len(self.owers) + else: + return 0 def __repr__(self): return "<Bill of %s from %s for %s>" % (self.amount, |
