Skip to content

Add a compact number formatter for large pair volumes #482

Description

@mikewheeleer

Format large volumes compactly (for example 1.2M)

Description

Large volume numbers render in full, hurting scannability. This issue adds a compact formatter (K/M/B) used by the pairs and stats views, with an accessible full value.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-frontend only.
  • Add a formatCompactNumber helper (locale-aware, using Intl compact notation) and apply it where large volumes render.
  • Expose the precise value via a title/aria so no information is lost.
  • Cover rounding at each magnitude boundary.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/format-01-compact-numbers
  • Implement changes
    • Write code in: lib format helpers; apply at the pair/stats render sites.
    • Write comprehensive tests in: boundaries at K/M/B, small numbers unchanged, negative values.
  • Test and commit

Test and commit

  • Run npm run lint, npm test, and npm run build.
  • Cover edge cases: 999 vs 1000, exact 1,000,000, negatives, zero.
  • Include the full test output in the PR description.

Example commit message

feat(format): add compact large-number formatter

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions