Skip to content

Commit

Permalink
Ready for release 2.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Oct 24, 2022
2 parents 8d4eda7 + 2161d3e commit 1e9ebf9
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 379 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Cldr_Numbers v2.28.0

This is the changelog for Cldr v2.28.0 released on October 24th, 2022. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_numbers/tags)

* Encapsulates [CLDR 42](https://cldr.unicode.org/index/downloads/cldr-42) data. Unless otherwise noted, all the changes are reflected in `ex_cldr` libraries and functions.

## Cldr_Numbers v2.27.3

This is the changelog for Cldr v2.27.3 released on October 8th, 2022. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_numbers/tags)
Expand Down
7 changes: 5 additions & 2 deletions lib/cldr/number/backend/format.ex
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ defmodule Cldr.Number.Backend.Format do
## Example
iex> #{inspect(__MODULE__)}.decimal_format_list_for(:en)
{:ok, ["#,##0%", "#,##0.###", "#E0", "0 billion", "0 million", "0 thousand",
{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
"0 billion", "0 million", "0 thousand",
"0 trillion", "00 billion", "00 million", "00 thousand", "00 trillion",
"000 billion", "000 million", "000 thousand", "000 trillion", "000B", "000K",
"000M", "000T", "00B", "00K", "00M", "00T", "0B", "0K", "0M", "0T",
"¤#,##0.00", "¤#,##0.00;(¤#,##0.00)", "¤000B", "¤000K", "¤000M",
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T"]}
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T",
"¤ #,##0.00", "¤ #,##0.00;(¤ #,##0.00)", "¤ 000B", "¤ 000K", "¤ 000M",
"¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}
"""
@spec decimal_format_list_for(LanguageTag.t() | Cldr.Locale.locale_name()) ::
Expand Down
2 changes: 1 addition & 1 deletion lib/cldr/number/backend/rbnf.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Cldr.Number.Backend.Rbnf do
defined in the Unicode CLDR data repository. Available rules are identified by:
iex> #{inspect(__MODULE__)}.rule_sets(#{inspect(unquote(root_locale))})
[:tamil, :roman_upper, :roman_lower, :hebrew_item,
[:zz_default, :tamil, :roman_upper, :roman_lower, :hebrew_item,
:hebrew, :greek_upper, :greek_lower, :georgian,
:ethiopic, :cyrillic_lower, :armenian_upper, :armenian_lower]
Expand Down
7 changes: 5 additions & 2 deletions lib/cldr/number/format.ex
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ defmodule Cldr.Number.Format do
## Example
iex> Cldr.Number.Format.decimal_format_list_for("en", MyApp.Cldr)
{:ok, ["#,##0%", "#,##0.###", "#E0", "0 billion", "0 million", "0 thousand",
{:ok, ["#,##0%", "#,##0.###", "#,##0.00", "#,##0.00;(#,##0.00)","#E0",
"0 billion", "0 million", "0 thousand",
"0 trillion", "00 billion", "00 million", "00 thousand", "00 trillion",
"000 billion", "000 million", "000 thousand", "000 trillion", "000B", "000K",
"000M", "000T", "00B", "00K", "00M", "00T", "0B", "0K", "0M", "0T",
"¤#,##0.00", "¤#,##0.00;(¤#,##0.00)", "¤000B", "¤000K", "¤000M",
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T"]}
"¤000T", "¤00B", "¤00K", "¤00M", "¤00T", "¤0B", "¤0K", "¤0M", "¤0T",
"¤ #,##0.00", "¤ #,##0.00;(¤ #,##0.00)", "¤ 000B", "¤ 000K", "¤ 000M",
"¤ 000T", "¤ 00B", "¤ 00K", "¤ 00M", "¤ 00T", "¤ 0B", "¤ 0K", "¤ 0M", "¤ 0T"]}
"""
@spec decimal_format_list_for(LanguageTag.t() | Locale.locale_name(), Cldr.backend()) ::
Expand Down
2 changes: 1 addition & 1 deletion lib/cldr/number/system.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defmodule Cldr.Number.System do
## Example
iex> Cldr.Number.System.number_systems |> Enum.count
86
88
"""
@spec number_systems :: map()
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Cldr.Numbers.Mixfile do

use Mix.Project

@version "2.27.3"
@version "2.28.0"

def project do
[
Expand Down Expand Up @@ -41,8 +41,8 @@ defmodule Cldr.Numbers.Mixfile do

defp deps do
[
{:ex_cldr, "~> 2.28"},
{:ex_cldr_currencies, "~> 2.14"},
{:ex_cldr, "~> 2.34"},
{:ex_cldr_currencies, ">= 2.14.2"},
{:digital_token, "~> 0.3 or ~> 1.0"},

{:decimal, "~> 1.6 or ~> 2.0"},
Expand Down
7 changes: 3 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
"dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"},
"digital_token": {:hex, :digital_token, "0.4.0", "2ad6894d4a40be8b2890aad286ecd5745fa473fa5699d80361a8c94428edcd1f", [:mix], [{:cldr_utils, "~> 2.17", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "a178edf61d1fee5bb3c34e14b0f4ee21809ee87cade8738f87337e59e5e66e26"},
"earmark": {:hex, :earmark, "1.4.14", "d04572cef64dd92726a97d92d714e38d6e130b024ea1b3f8a56e7de66ec04e50", [:mix], [{:earmark_parser, ">= 1.4.12", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "df338b8b1852ee425180b276c56c6941cb12220e04fe8718fe4acbdd35fd699f"},
"earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"},
"earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_cldr": {:hex, :ex_cldr, "2.33.2", "8adc4df3985e7f5d1d55cbbf72f993569de20eff5012ff3ea9412753961d4c00", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.5", [hex: :certifi, repo: "hexpm", optional: true]}, {:cldr_utils, "~> 2.18", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.19", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: true]}], "hexpm", "fd81a7147b4ed86c0c44c0251444cb8d1defccc7b33b89067ca1635f23e9fbf8"},
"ex_cldr": {:hex, :ex_cldr, "2.34.0", "50385e1445f33537bea7d24ca7525aa849ccabb3cf88ac41a6d183693116aba7", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.5", [hex: :certifi, repo: "hexpm", optional: true]}, {:cldr_utils, "~> 2.18", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.19", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: true]}], "hexpm", "d026df7d580424ab8daf0d908fd38d3c12e0a63962b495b7faeabd66ab072588"},
"ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.14.2", "354b48134faa011d58ae2e89be69b7de607d81fcc74c7ac684c5fb77b20186f5", [:mix], [{:ex_cldr, "~> 2.27", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "c970533103cdc97b1dedc2fead2209c0f5ae0aee0f1e504fdea5be5ee1466cd1"},
"ex_doc": {:hex, :ex_doc, "0.28.5", "3e52a6d2130ce74d096859e477b97080c156d0926701c13870a4e1f752363279", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "d2c4b07133113e9aa3e9ba27efb9088ba900e9e51caa383919676afdf09ab181"},
"ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"},
"exprintf": {:hex, :exprintf, "0.2.1", "b7e895dfb00520cfb7fc1671303b63b37dc3897c59be7cbf1ae62f766a8a0314", [:mix], [], "hexpm", "20a0e8c880be90e56a77fcc82533c5d60c643915c7ce0cc8aa1e06ed6001da28"},
"exprof": {:hex, :exprof, "0.2.4", "13ddc0575a6d24b52e7c6809d2a46e9ad63a4dd179628698cdbb6c1f6e497c98", [:mix], [{:exprintf, "~> 0.2", [hex: :exprintf, repo: "hexpm", optional: false]}], "hexpm", "0884bcb66afc421c75d749156acbb99034cc7db6d3b116c32e36f32551106957"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
Expand Down
149 changes: 149 additions & 0 deletions mix/rbnf_test_data_gen.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
defmodule Cldr.Rbnf.Gen do
@moduledoc """
Generates test data values for RBNF.
Only to be used if something changes in
CLDR
The json included here has the standard test
keys used by RBNF testing. The values will be
replaced with generated data.
"""
@json ~S"""
{
"-1141": "−1 141.",
"-1142": "−1 142.",
"-1143": "−1 143.",
"-100": "−100.",
"-75": "−75-и",
"-50": "−50.",
"-24": "−24.",
"0": "0.",
"1": "1-ви",
"2": "2-и",
"3": "3-и",
"4": "4-ти",
"5": "5-и",
"6": "6-и",
"7": "7-и",
"8": "8-и",
"9": "9-и",
"10": "10-и",
"11": "11-и",
"12": "12-и",
"13": "13-и",
"14": "14-и",
"15": "15-и",
"16": "16-и",
"17": "17-и",
"18": "18-и",
"19": "19-и",
"20": "20-и",
"21": "21-и",
"22": "22-и",
"23": "23-и",
"24": "24-ти",
"25": "25-и",
"26": "26-и",
"27": "27-и",
"28": "28-и",
"29": "29-и",
"30": "30-и",
"31": "31-и",
"32": "32-и",
"33": "33-и",
"34": "34-и",
"35": "35-и",
"36": "36-и",
"37": "37-и",
"38": "38-и",
"39": "39-и",
"40": "40-и",
"41": "41-и",
"42": "42-ри",
"43": "43-и",
"44": "44-и",
"45": "45-и",
"46": "46-и",
"47": "47-и",
"48": "48-и",
"49": "49-и",
"50": "50-и",
"51": "51-ви",
"52": "52-и",
"53": "53-и",
"54": "54-и",
"55": "55-и",
"56": "56-и",
"57": "57-и",
"58": "58-и",
"59": "59-и",
"60": "60-и",
"61": "61-и",
"62": "62-и",
"63": "63-и",
"64": "64-и",
"65": "65-и",
"66": "66-и",
"67": "67-и",
"68": "68-и",
"69": "69-и",
"70": "70-и",
"71": "71-и",
"72": "72-и",
"73": "73-и",
"74": "74-и",
"75": "75-и",
"76": "76-и",
"77": "77-и",
"78": "78-и",
"79": "79-и",
"80": "80-и",
"81": "81-и",
"82": "82-и",
"83": "83-и",
"84": "84-и",
"85": "85-и",
"86": "86-и",
"87": "87-и",
"88": "88-и",
"89": "89-и",
"90": "90-и",
"91": "91-и",
"92": "92-и",
"93": "93-и",
"94": "94-и",
"95": "95-и",
"96": "96-и",
"97": "97-и",
"98": "98-и",
"99": "99-и",
"100": "100.",
"321": "321.",
"322": "322.",
"323": "323.",
"1141": "1141-и",
"1142": "1142-и",
"1143": "1143-и",
"10311": "10 311.",
"138400": "138 400-тен"
}
"""

def gen(rule, locale) do
@json
|> Jason.decode!()
|> Enum.map(fn {k, _v} ->
i = String.to_integer(k)
{:ok, v} = Cldr.Number.to_string(i, format: rule, locale: locale)
{i, v}
end)
|> Enum.sort
|> Enum.map(fn {k, v} -> "\"#{k}\": \"#{v}\"" end)
|> Enum.join(",\n")
|> IO.puts

nil
end
end
2 changes: 1 addition & 1 deletion test/number/number_format_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ defmodule Number.Format.Test do
assert Cldr.Number.to_string(1_000_000_000, format: :currency_long_with_symbol) ==
{:ok, "$1 billion"}
assert Cldr.Number.to_string(1_000_000_000, format: :currency_long_with_symbol, locale: "hr") ==
{:ok, "1 milijardi kn"}
{:ok, "1 milijardi "}
assert Cldr.Number.to_string(1_000_000_000, format: :currency_long_with_symbol, locale: "hr", currency: :USD) ==
{:ok, "1 milijardi USD"}
assert Cldr.Number.to_string(1234545656.456789, currency: "BTC", format: :currency_long_with_symbol) ==
Expand Down

0 comments on commit 1e9ebf9

Please sign in to comment.