Skip to content

fix: preserve XLM display precision - #115

Open
isaacsamual994-lang wants to merge 7 commits into
MergeFi:mainfrom
isaacsamual994-lang:fix/xlm-display-precision-76
Open

isaacsamual994-lang wants to merge 7 commits into
MergeFi:mainfrom
isaacsamual994-lang:fix/xlm-display-precision-76

Conversation

@isaacsamual994-lang

Copy link
Copy Markdown

Fixes #76

Summary

  • keep USDC visible formatting at the existing two-decimal policy
  • display XLM with up to seven decimal places, matching Stellar stroop precision
  • prevent finite non-zero sub-stroop values from appearing as a literal zero
  • share one asset-aware formatter between formatCurrency and StatCard display/tooltip values
  • add regression coverage for ordinary, small, bounded, negative, and USDC-compatible cases

Verification

  • npm test -- --runInBand src/lib/utils.test.ts src/components/ui/StatCard.test.tsx — 59/59 tests passed
  • npm run lint — passed
  • npm run build — passed, including TypeScript and production page generation

Call-site audit

Repository search found formatCurrency used as display text across the issue, milestone, bounty-card, activity, reputation, landing, and dashboard views. The inspected consumers do not derive layout or business logic from the formatted string, and the production build passed with the longer XLM output.

Test-runner note

The repository's TypeScript Jest configuration currently requires ts-node, but it is not declared in the project. The isolated verification run supplied it transiently with npm install --no-save ts-node; this PR does not modify dependencies or CI.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@isaacsamual994-lang is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

formatCurrency and StatCard hardcode 2-decimal precision for every asset, discarding XLM's native 7-decimal precision

1 participant