andreasalstrup / CoShare

SW7 semester project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix calculateBalance to accommodate variable number of users

mikejensen0 opened this issue · comments

Currently, calculateBalance calculates using number of users in the group, meaning an expense between two users will also be calculated between the rest of the group.

Example expense:
Alice paid 50,-
Bob paid 0,-
Charlie is not part of the expense

Expected balances:

Alice: +25
Bob: -25
Charlie: 0

Actual balances:

Alice: +25
Bob: -12.5
Charlie: -12.5

Wait until #62 has been resolved, before tackling this issue.