Skip to content

Show exact calculated balances in the Dashboard review preview - #204

Open
31b4 wants to merge 2 commits into
mainfrom
bug/203-dashboard-decimal-sums
Open

31b4 wants to merge 2 commits into
mainfrom
bug/203-dashboard-decimal-sums

Conversation

@31b4

@31b4 31b4 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #203

Summary

Dashboard review previews exposed floating-point residue because they summed saved balances and pending amounts with ordinary addition. Calculate preview balances and split totals with the existing decimal arithmetic helper while preserving stored amount precision.

Changes

  • Sum the account balance and all eligible review deltas together with decimal arithmetic.
  • Use the same helper for posted/pending split totals and split editor totals.
  • Cover fractional EUR balances, negative MXN/HUF results, multiple draft deltas, unchanged saved balances and read-only preview behavior.

Verification

  • Node 22.23.2: all 63 client test files / 590 tests passed.
  • Client lint passed with zero warnings.
  • Production client build passed, including TypeScript checks.
  • Client-only deployment completed on 2026-11-17 from current main plus this fix (commit ff59c08); no API, MCP or database deployment.
  • Verified the real production Dashboard in the authenticated browser: negative MXN/HUF confirmation previews now show exact two-decimal results without residue. The existing service worker required a second reload to activate the updated client.
  • PR remains open for merge review; GitHub CI is running for the added regression tests.

31b4 added 2 commits November 13, 2026 11:42
The Needs review confirmation preview added the account balance and pending
deltas with floating-point addition. Since amounts keep their saved precision
(#198), the residue became visible, e.g. 8968.53 - 6.40 shown as
8962.130000000001. Sum the preview and split group totals with the shared
decimal helper instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix floating-point residue in calculated Dashboard balances

1 participant