Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure commas in numbers for legibility #130 #266

Merged
merged 19 commits into from
Jan 20, 2025

Conversation

dkackman
Copy link
Contributor

@dkackman dkackman commented Jan 14, 2025

This PR introduces number localization for amount values. #130

  • locale is whatever the navigator.language is
  • formatting is deferred to number.toLocaleString
  • Anywhere a value in xch or cat is displayed it should be localized
  • it should respect walletState.sync.unit.decimals and 3 for CATS
  • a couple of helper functions were introduced:
    • fromMojos used in a number of places instead of toDecimal to avoid number to string to number to string
    • formatNumber to wrap toLocaleString and handle type conversions
    • NumberFormat component for inclusion in markup

This same pattern can be used for DateTimes when the show up (#243)

@dkackman
Copy link
Contributor Author

dkackman commented Jan 14, 2025

@BrandtH22 @Rigidity this is ready for review. I believe I did a thorough job of finding places where amounts should be formatted but I likely missed a spot or two.

@dkackman
Copy link
Contributor Author

just did a merge form main. picked up an extra commit that i did not intend. low risk change to add more columns to the token grid on larger screens. 8a345ef

@Rigidity Rigidity merged commit d5ea19a into xch-dev:main Jan 20, 2025
6 of 8 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.

2 participants