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

Make the constructor case-insensitive #947

Open
danielt998 opened this issue Apr 1, 2024 · 1 comment
Open

Make the constructor case-insensitive #947

danielt998 opened this issue Apr 1, 2024 · 1 comment

Comments

@danielt998
Copy link

If I run the following:

console.log("Globalize curr with currencyFormatter, ja-jp:" + Globalize("ja-jp").currencyFormatter("BGN", {
        compact: "short"
      })(112310));

      console.log("Globalize curr with currencyFormatter, ja-JP:" + Globalize("ja-JP").currencyFormatter("BGN", {
        compact: "short"
      })(112310));

I get

Globalize curr with currencyFormatter, ja:BGN 112K
Globalize curr with currencyFormatter, ja:BGN 11万

the latter of which is correct. I think the constructor should automatically capitalise the locale code correctly as this feels like something that could catch a lot of people out (I might be happy to raise a PR myself)

@danielt998
Copy link
Author

Also I think it would be helpful to emit a warning when a locale passed in is invalid, this is such an easy thing to miss

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