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

should provide parameter for currency type and language #2

Open
ericblade opened this issue Jan 3, 2022 · 0 comments
Open

should provide parameter for currency type and language #2

ericblade opened this issue Jan 3, 2022 · 0 comments

Comments

@ericblade
Copy link
Owner

Intl.NumberFormat(navigator.languages[0], {style: 'currency', currency: 'USD'}).format('1234.56');

adding a language and currency field would allow for us to use the built-in Intl to format instead.

If not provided, can still use navigator.languages[0] (there are packages out there that also derive from navigator.language, and older specs, but i don't think we need to really go out of our way to support old browsers, do we?) and assume USD.

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

No branches or pull requests

1 participant