Releases: elixir-cldr/cldr_units
Cldr Units version 3.17.2
Cldr Units version 3.17.0
Bug Fixes
- Fixes canonical unit name formation. More units can now be resolved to a base unit and therefore compared and converted with other units. The primary change is to add elimination of common factors in "per" units.
Enhancements
-
Add conversion support for Beaufort. This conversion is non linear and therefore cannot be expressed using the normal unit conversion method.
-
Cldr.Unit.Math.mult/2
andCldr.Unit.Math.div/2
now support scalar values as the second argument. It's therefore now possible to sayCldr.Unit.Math.mult(Cldr.Unit.new!(:meter, 10), 2)
.
Cldr Units version 3.16.4
Bug Fixes
- Fix compiler warnings for Elixir 1.16.
Cldr Units version 3.16.3
Bug Fixes
- Fix use of user-defined units (known as additional units). Closes #40.
Cldr Units version 3.16.1
Bug Fixes
-
Assert a defined order of map keys in order to operate correctly on OTP 26.
-
Works around an OTP 26 bug when binary pattern matching in function heads.
-
Removes a compiler warning in Elixir 1.15 (which is actually a compile error in Elixir 1.15.0-rc.0)
Cldr Units version 3.16.0
Bug Fixes
- Support Decimal version 2.1 and later which raise a different exception that older releases when calling
Decimal.to_integer/1
when the value isn't convertible.
Enhancements
-
Updates to CLDR 43 data. The unit
:beaufort
is introduced but only in some locales. -
Remove the dependency on
ratio
. All unit values are now decimals. -
Support string-formatted decimals in
Cldr.Unit.new/3
. This allows the creation of units likeCldr.Unit.new(:foot, "3.39")
which will also be produced now by theInspect
protocol. Apart from the inherent consistency this also improves accuracy will all tests for conversion and preference from CLDR test data now passing. -
Add a
Cldr.Unit.Range
type to allow creating, enumerating and formatting unit ranges. Thanks to @ribanez7 for the collaboration. Closes #33. -
Add support for multiplication and division of arbitrary units. Thanks to @maennchen for the report (and patience). Closes #32.
-
Adjust the inspect protocol implementation to emit executable code strings.
Cldr Units version 3.15.0
- Updates to CLDR 42. There are two changes to the unit data:
- The length of a light-year has been adjusted to the IAU value (which uses a Julian year of 365.25 days).
- The unit ID for metric-tonne has been deprecated in favor of tonne.
Updated data from CLDR
- The new
-u
extension key to the language tag is added to provide a preferred unit of measurement for temperature: Celsius, Fahrenheit, and Kelvin. This extension is parsed but is not yet utilised byex_cldr_units
. It will be applied in an update before year end 2022.
Cldr Units version 3.14.0
Cldr Units version 3.13.3
Bug Fixes
- Fix unit comparison for unit values built from decimal strings. Thanks to @seantanly for the report. Closes #29.
Cldr Units version 3.13.2
Bug Fixes
- Fix
MyApp.Cldr.Unit.localize/2
which was previously delegating incorrectly toCldr.Unit
.