Skip to content

Conversation

n3ps
Copy link
Contributor

@n3ps n3ps commented Sep 12, 2025

Explanation

This is a port of the new Intl.NumberFormat currency formatters from metamask-extension. Moving it a shared library so it can be consumed from both mobile and extension.

  • What is the current state of things and why does it need to change?
    There is inconsistent and multiple one-off implementations for fiat currency and token formatting in the mobile and extension clients

  • What is the solution your changes offer and how does it work?
    Create a shared set of formatters that aligns mobile and extension.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@n3ps n3ps marked this pull request as ready for review September 12, 2025 14:26
@n3ps n3ps requested review from a team as code owners September 12, 2025 14:26
cursor[bot]

This comment was marked as outdated.

@n3ps n3ps enabled auto-merge (squash) September 12, 2025 18:00
@mcmire
Copy link
Contributor

mcmire commented Sep 15, 2025

Eventually it may be a good idea to move these over to the @metamask/utils repo, depending on where they are likely to be used.

That said for now this seems good.

@n3ps
Copy link
Contributor Author

n3ps commented Sep 15, 2025

Eventually it may be a good idea to move these over to the @metamask/utils repo, depending on where they are likely to be used.

That said for now this seems good.

@mcmire Discussed this with Mark, I considered utils but the formats cater more closely with MetaMask's use cases

@mcmire
Copy link
Contributor

mcmire commented Sep 15, 2025

@n3ps I see. Sounds good!

@n3ps n3ps merged commit 455d762 into main Sep 15, 2025
239 checks passed
@n3ps n3ps deleted the n3ps/formatters branch September 15, 2025 15:15
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.

6 participants