Skip to content

feat(format): add compact large-number formatter - #572

Merged
mikewheeleer merged 2 commits into
StableRoute-Org:mainfrom
Truphile:feature/format-01-compact-numbers
Jul 25, 2026
Merged

feat(format): add compact large-number formatter#572
mikewheeleer merged 2 commits into
StableRoute-Org:mainfrom
Truphile:feature/format-01-compact-numbers

Conversation

@Truphile

Copy link
Copy Markdown
Contributor

Summary of Work

  1. Compact Formatter (formatCompactNumber & formatCompactNumberDisplay):
    • Added locale-aware compact number formatter helpers using Intl.
    NumberFormat in format.ts.
    • Handles magnitudes: K, M, B, zero, negative values, and non-finite
    numbers while preserving the raw precise value in title and aria-label.
  2. Pairs and Stats Views Integration:
    • Applied compact formatting to pair volume in PairsDrawer.tsx and
    pairs count badge in Client.tsx.
    • Applied compact formatting to StatTile.tsx and router metrics in
    Client.tsx, exposing full precise values via title and aria-label.
  3. Comprehensive Unit Test Coverage:
    • Added unit tests covering small numbers, rounding boundaries at K, M,
    B, zero, negative values, non-finite numbers, and custom locale
    formatting in format.test.ts.
    • Updated component and page unit tests in PairsDrawer.test.tsx and
    page.test.tsx.
  4. Verification:
    • Ran npm test: 71 passed, 71 total (1071/1071 individual tests passed).
    • Ran npm run lint: 0 errors or warnings.
    • Ran npm run build: Compiled static production build successfully.

closes #482

@Truphile
Truphile force-pushed the feature/format-01-compact-numbers branch from 66c60fb to 76832a1 Compare July 24, 2026 20:46
@mikewheeleer

Copy link
Copy Markdown
Contributor

@Truphile this is clean and complete. merging, thank you! ✨

@mikewheeleer
mikewheeleer merged commit 313b3bb into StableRoute-Org:main Jul 25, 2026
3 checks passed
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.

Add a compact number formatter for large pair volumes

2 participants