BillTracker/client/components
null a15f00c568 refactor(client): single source of truth for money formatting (IMP-CODE-01)
The client had ~15 hand-rolled currency formatters (local `fmt`/`money`/
`fmtFull`/`fmtDollars`/…) plus a canonical `fmt` in lib/utils used at ~190
sites — same rules copy-pasted, with inconsistent handling of negatives,
whole-dollar, cents vs dollars, and blank input.

Add client/lib/money.js as the one implementation:
  - formatUSD(dollars)      — "$1,234.56" (whole/dash options)
  - formatUSDWhole(dollars) — "$1,235"
  - formatCentsUSD(cents)   — from integer cents; signed "+/-" and dash options
Inputs are coerced so null/''/NaN never render as "$NaN", and -0 is
normalized so it never shows as "-$0.00".

lib/utils.fmt now delegates to formatUSD (byte-identical — the existing
utils.test.js fmt suite is the regression guard), and the 15 local
formatters delegate to money.js. No display currency formatting remains
outside money.js; the /100 conversions left behind are calculations
(form prefill), not display.

Tests: client/lib/money.test.js (13). Full client suite 46 pass; build clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 12:46:22 -05:00
..
admin fix(bank-sync): admin config, matching, and worker updates 2026-06-07 19:41:17 -05:00
data refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
layout feat(banking): bank transactions ledger page with route, sidebar link, and API endpoint 2026-06-12 03:59:42 -05:00
snowball refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
tracker feat(cashflow): safe-to-spend projection with timeline, vitest setup, package upgrades 2026-06-12 01:32:28 -05:00
transactions refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
ui feat(settings): auto-save preferences with live save status (batch 0.39.0) 2026-06-12 02:08:42 -05:00
BillHistoricalImportDialog.jsx fix: historical import loading state, remove stray catalog export 2026-06-06 23:17:08 -05:00
BillMerchantRules.jsx refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
BillModal.jsx refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
BillRulesManager.jsx feat: bill rules manager page, merchant re-normalization, match suggestion scoring fix, cleanup pruning 2026-06-04 20:45:11 -05:00
BillsTableInner.jsx refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
CalendarFeedManager.jsx fix(ui): calendar settings improvements 2026-06-07 16:52:50 -05:00
CommandPalette.jsx feat: Payoff Custom mode, Summary reordering, unifed billing schedule, SimpleFIN + backup fixes (batch v0.34.1.3) 2026-05-30 21:20:51 -05:00
ErrorBoundary.jsx v0.19.2: add React Error Boundaries for crash recovery 2026-05-09 18:33:02 -05:00
IncomeBreakdownModal.jsx refactor(client): single source of truth for money formatting (IMP-CODE-01) 2026-07-03 12:46:22 -05:00
MarkdownText.jsx initial commit 2026-05-03 19:51:57 -05:00
MobileBillRow.jsx feat: live transaction search in merchant rules, link-import preference toggle, tracker row tweaks 2026-06-06 23:04:53 -05:00
MobileTrackerRow.jsx fix(utils): extract localDateString to shared lib, replace .toISOString().slice() pattern across client 2026-06-11 23:40:22 -05:00
PageLoader.jsx v0.20.1: code splitting, version badge on roadmap, roadmap nav link 2026-05-09 22:01:19 -05:00
PageTransition.jsx chore(client): update PageTransition spacing 2026-06-09 20:51:32 -05:00
ReleaseNotesDialog.jsx 0.34.3 2026-05-31 15:06:10 -05:00
SearchFilterPanel.jsx fix(tracker): search filter and bucket improvements 2026-06-07 17:33:31 -05:00
StatusBadge.jsx style: stronger late/missed payment visibility 2026-05-28 23:42:46 -05:00
SubscriptionCatalogSection.jsx feat: dedicated subscription catalog page, evidence badges, price display in recommendations 2026-06-06 20:44:54 -05:00
SummaryCard.jsx style: global readability/theme pass 2026-05-28 23:18:14 -05:00