Skip to content

Commit

Permalink
Update to CLDR v42.
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanz committed Oct 20, 2022
1 parent 5491042 commit 28b0298
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Handles currency amounts, provides currency information and formatting.

Powered by CLDR v41, in just ~30kb of data.
Powered by CLDR v42, in just ~30kb of data.

Backstory: https://bojanz.github.io/price-currency-handling-go/

Expand Down
98 changes: 57 additions & 41 deletions data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestFormatter_Format(t *testing.T) {
{"1234.00", "CHF", "sr", "1.234,00\u00a0CHF"},

// Arabic digits.
{"12345678.90", "USD", "ar", "١٢٬٣٤٥٬٦٧٨٫٩٠\u00a0US$"},
{"12345678.90", "USD", "ar", "\u200f١٢٬٣٤٥٬٦٧٨٫٩٠\u00a0US$"},
// Arabic extended (Persian) digits.
{"12345678.90", "USD", "fa", "\u200e$۱۲٬۳۴۵٬۶۷۸٫۹۰"},
// Bengali digits.
Expand Down Expand Up @@ -95,11 +95,6 @@ func TestFormatter_Grouping(t *testing.T) {
{"1234.99", "USD", "hi", false, "$1,234.99"},
{"1234567.99", "USD", "hi", false, "$12,34,567.99"},
{"12345678.99", "USD", "hi", false, "$1,23,45,678.99"},

// The "bg" locale doesn't support grouping.
{"123.99", "EUR", "bg", false, "123,99\u00a0€"},
{"1234.99", "EUR", "bg", false, "1234,99\u00a0€"},
{"1234567.99", "EUR", "bg", false, "1234567,99\u00a0€"},
}

for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func shouldIgnoreLocale(locale string) bool {
// Not present in "modern" data, just listed in parentLocales.
"bm", "byn", "dje", "dyo", "ff", "ha", "shi", "vai", "wo", "yo",
// Infrequently used locales.
"jv", "kn", "ml", "row", "sat", "sd",
"jv", "kn", "ml", "row", "sat", "sd", "to",
}
localeParts := strings.Split(locale, "-")
ignore := false
Expand Down

0 comments on commit 28b0298

Please sign in to comment.