Skip to content

feat(lib): format stroop values with locale grouping#137

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
YfengJ:codex/format-stroops-74
Jun 24, 2026
Merged

feat(lib): format stroop values with locale grouping#137
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
YfengJ:codex/format-stroops-74

Conversation

@YfengJ

@YfengJ YfengJ commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #74.

Summary

  • update formatStroops to use Intl.NumberFormat with deterministic en-US grouping
  • keep 0 XLM, preserve the public formatStroops(stroops: number): string signature, and show non-zero sub-cent values as grouped raw stroops instead of hiding them behind 0.00 XLM
  • format XLM values with at least 2 and up to 7 fraction digits so large and fractional balances stay readable
  • route formatRequests through the same grouped integer formatter
  • update README formatting notes and affected tests
  • clean up two existing test/lint blockers so the repo-level validation command can run green

Validation

  • npm run lint
  • npm run typecheck
  • npm test -- --runInBand (43 suites, 334 passed, 2 skipped; existing React act warning is still printed by AgentsPage tests)
  • npm run build
  • npm test -- src/lib/__tests__/format.test.ts --runInBand --coverage --collectCoverageFrom=src/lib/format.ts --coverageThreshold='{"global":{"statements":0,"branches":0,"functions":0,"lines":0},"src/lib/format.ts":{"statements":95,"branches":90,"functions":95,"lines":95}}'

format.ts coverage from the targeted coverage run:

  • Statements: 100%
  • Branches: 93.18%
  • Functions: 100%
  • Lines: 100%

@mikewheeleer

Copy link
Copy Markdown
Contributor

clean diff — thanks for this!

@mikewheeleer mikewheeleer merged commit e179865 into Agentpay-Org:main Jun 24, 2026
1 check 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 an XLM/stroops toggle and locale grouping to the formatStroops helper

2 participants