MinimumCashFlow
Class methods
Computes net balances from per-expense weight splits. Positive means the member should receive money; negative means they owe.
Turns balances into a minimal, deterministic set of pairwise payments.
split_amount_by_weight(amount_cents : Int32, member_weights : Hash(Int64, Int32)) : Hash(Int64, Int32)
Splits amount_cents among members proportional to their weights.
The split is:
- deterministic (tie-break by member id)
- exact in cents (sums back to
amount_cents)
Remainder cents are distributed to members with the largest fractional remainders first.