cldr_units
cldr_units copied to clipboard
Regressions from 3.16
Hi, we ran into a couple of issues updating this library from 3.16.4 to 3.17
1. Cldr.Unit.parse_unit_name returns string instead of atom
iex> Cldr.Unit.parse_unit_name("mg/dl")
# Before 3.17
{:ok, :milligram_ofglucose_per_deciliter}
# After 3.17
{:ok, "milligram_ofglucose_per_deciliter"}
2. Cannot format Unit with unit_name "mg/dl"
The following function call does not work in 3.17 any more
iex> Cldr.Unit.to_string!(Cldr.Unit.new!("milligram_ofglucose_per_deciliter", "120.5"), style: :short)
# Before 3.17
"120.5 mg/dL"
# After 3.17
** (Cldr.Unit.NoPatternError) No format pattern was found for unit Cldr.Unit.new!("milligram_ofglucose_per_deciliter", "120.5") with grammatical case :nominative, gender :neuter and plural type :other
stacktrace:
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:807: Cldr.Unit.Format.get_unit_pattern!/3
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:714: Cldr.Unit.Format.do_iolist/3
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:682: Cldr.Unit.Format.do_iolist/3
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:631: Cldr.Unit.Format.to_iolist/4
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:639: Cldr.Unit.Format.to_iolist/4
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:470: Cldr.Unit.Format.to_iolist/3
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:201: Cldr.Unit.Format.to_string/3
(ex_cldr_units 3.17.0) lib/cldr/unit/format.ex:316: Cldr.Unit.Format.to_string!/3