Skip to content

Releases: elixir-cldr/cldr_units

Cldr Units version 3.17.2

16 Aug 15:11
Compare
Choose a tag to compare

Bug Fixes

  • Fix specs to suport dialyzer flags :error_handling, :unknown, :underspecs, :extra_return, :missing_return

Cldr Units version 3.17.0

20 Apr 22:50
Compare
Choose a tag to compare

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 and Cldr.Unit.Math.div/2 now support scalar values as the second argument. It's therefore now possible to say Cldr.Unit.Math.mult(Cldr.Unit.new!(:meter, 10), 2).

Cldr Units version 3.16.4

02 Nov 10:09
Compare
Choose a tag to compare

Bug Fixes

  • Fix compiler warnings for Elixir 1.16.

Cldr Units version 3.16.3

25 Sep 06:47
Compare
Choose a tag to compare

Bug Fixes

  • Fix use of user-defined units (known as additional units). Closes #40.

Cldr Units version 3.16.1

23 May 14:38
Compare
Choose a tag to compare

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

28 Apr 01:13
Compare
Choose a tag to compare

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 like Cldr.Unit.new(:foot, "3.39") which will also be produced now by the Inspect 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

24 Oct 05:38
Compare
Choose a tag to compare
  • 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 by ex_cldr_units. It will be applied in an update before year end 2022.

Cldr Units version 3.14.0

08 Oct 01:36
Compare
Choose a tag to compare

Enhancements

  • Add Cldr.Unit.parse_unit_name/2 to parse a string as unit name. Also adds MyApp.Cldr.parse_unit_name/2 as well as the ! versions of these functions. Thanks to @Awlexus for the PR. Closes #31.

Cldr Units version 3.13.3

03 Aug 09:26
Compare
Choose a tag to compare

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

07 Jun 14:46
Compare
Choose a tag to compare

Bug Fixes

  • Fix MyApp.Cldr.Unit.localize/2 which was previously delegating incorrectly to Cldr.Unit.