Fix amortization float rounding leaving non-zero final balance #21

Open
opened 2026-06-06 19:58:13 +00:00 by tonym · 0 comments

Severity: medium
Category: correctness
Location: mortgage.py:51-55

Problem

Per-row round() over 360 months accumulates ~$3-5 error; the final schedule row shows a small non-zero balance so the loan looks unpaid at term.

Suggested fix

Track raw floats internally, round at display only, and append a final corrective payment if balance>0.

Filed by automated code review.

**Severity:** medium **Category:** correctness **Location:** `mortgage.py:51-55` ### Problem Per-row round() over 360 months accumulates ~$3-5 error; the final schedule row shows a small non-zero balance so the loan looks unpaid at term. ### Suggested fix Track raw floats internally, round at display only, and append a final corrective payment if balance>0. _Filed by automated code review._
tonym added the
correctness
severity:medium
labels 2026-06-06 19:58:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bonna61/Moon-Household-Budget#21
No description provided.