globalizejs / globalizejs/globalize

Make the constructor case-insensitive

Open
#947 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.