mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 01:34:51 +08:00
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.