Files
cc-switch/tests
Jason 85ae0c7ba2 refactor(usage): route usage amounts through one money formatter
Usage amounts were formatted in several places, each gluing "$" onto the
number itself: fmtUsd in format.ts, the request detail panel, the trend
chart's axis ticks and the session reader's own formatCost. Before a
display currency can be added, every one of them has to go through a
single path.

- Replace fmtUsd with formatMoney / formatMoneyCompact / formatMoneyTick.
  They take the display currency as a required argument, so a call site
  that is not converted fails the type check instead of silently showing
  dollars.
- Add useMoneyFormat(): the usage dashboard, the sidebar "Today" label
  and the session reader all format through it. It is fixed to USD for
  now; the setting will be wired in here.
- The session reader's markdown export takes formatCost in its options,
  so copied text uses the same currency as the screen.
- Pricing (entered in USD), quota and balance footers (the provider's own
  currency) and the Codex credit conversion are deliberately untouched.

No visible change: every amount renders exactly as before.
2026-10-16 19:29:23 +08:00
..