Skip to content

Releases: elixir-cldr/cldr_units

Cldr Units version 1.3.0

17 Oct 22:53
Compare
Choose a tag to compare

Enhancements

  • Update ex_cldr dependency to version 1.8.0 which uses CLDR data version 34.

  • Adds petabyte and atmosphere units

Cldr Units version 1.2.2

26 Aug 11:33
Compare
Choose a tag to compare

Bug Fixes

  • Cldr.Unit.Conversion.convert/2 now correctly accepts units with a decimal value. Fixes #8. Thanks to @LostKobrakai.

Cldr Units version 1.2.0

29 Mar 01:07
Compare
Choose a tag to compare

Enhancements

  • Update ex_cldr dependency to version 1.5.0 which uses CLDR data version 33.

  • Update ex_cldr_numbers dependency to 1.4.0

Cldr Units version 1.1.1

26 Jan 13:43
Compare
Choose a tag to compare

Bug Fixes

  • Moves protocol implementations to a separate source file so that recompilation on locale configuration change will work.

Cldr_Units version 1.1.0

11 Jan 21:08
Compare
Choose a tag to compare

Bug Fixes

  • Fixes the documentation for Cldr.Units.convert/2 and adds the correct spec. Thanks to @lostbokrakai. Closes #5.

Enhancements

  • Add Cldr.Unit.value(Unit.t) to return the value of the Unit. Closes #6.

  • Format the code with mix format

Cldr_Units version 1.0.1

17 Dec 00:06
Compare
Choose a tag to compare

Bug Fixes

  • Fixes the conversion rates for :centimeter and :picometer

Cldr_Units version 1.0

16 Dec 22:55
Compare
Choose a tag to compare

Cldr_Units v1.0.0 released on December 17th, 2017. For older changelogs please consult the release tag on GitHub

This version signals API stability and the first release candidate.

Breaking changes

  • Cldr.Unit.to_string/3 is now Cldr.Unit.to_string/2. The unit is now supplied as an option. For example:
iex> Cldr.Unit.to_string 23, unit: :gram
{:ok, "23 grams"}

iex> Cldr.Unit.to_string 23, unit: :gram, locale: "zh"
{:ok, "23克"}
  • Rename Cldr.Unit.available_units to Cldr.Unit.units

Enhancements

  • Add Cldr.Unit.round/3 which rounds the unit value to the specified number of decimal places using the specified rounding mode

  • Add Cldr.Unit.new/2 and Cldr.Unit.new!/2 to create a new %Cldr.Unit{} struct

  • Add Cldr.Unit.convert/2 to provide unit conversion for compatible unit types

  • Add Cldr.Unit.add/2, Cldr.Unit.sub/2, Cldr.Unit.mult/2, Cldr.Unit.div/2 basic arithmetic for compatible unit types

  • Add Cldr.Unit.jaro_match/2 and Cldr.Unit.best_match/2 functions that facilitate finding units by name

  • Add Cldr.Unit.compatible_units/1 to return the list of units that can be converted into each other

  • Add Cldr.Unit.compatible?/2 that returns a boolean indicating if two units are of the same type and are convertible to each other

  • Add Cldr.Unit.Alias module to manage unit name aliases which is helpful for user interfaces that use a combination of US spelling and British spelling

Cldr_Units 1.0.0-rc.0

23 Nov 04:31
Compare
Choose a tag to compare
Cldr_Units 1.0.0-rc.0 Pre-release
Pre-release

First candidate release for Cldr_Unit which represents the stable API for version 1.0.

Breaking changes

  • Cldr.Unit.to_string/3 is now Cldr.Unit.to_string/2. The unit is now supplied as an option. For example:
iex> Cldr.Unit.to_string 23, unit: :gram
{:ok, "23 grams"}

iex> Cldr.Unit.to_string 23, unit: :gram, locale: "zh"
{:ok, "23克"}
  • Rename Cldr.Unit.available_units to Cldr.Unit.units

Enhancements

  • Add Cldr.Unit.new/2 and Cldr.Unit.new!/2 to create a new %Cldr.Unit{} struct

  • Add Cldr.Unit.convert/2 to provide unit conversion for compatible unit types

  • Add Cldr.Unit.add/2, Cldr.Unit.sub/2, Cldr.Unit.mult/2, Cldr.Unit.div/2 basic arithmetic for compatible unit types

  • Add Cldr.Unit.jaro_match/2 and Cldr.Unit.best_match/2 functions that facilitate finding units by name

  • Add Cldr.Unit.compatible_units/1 to return the list of units that can be converted into each other

  • Add Cldr.Unit.compatible?/2 that returns a boolean indicating if two units are of the same type and are convertible to each other

  • Add Cldr.Unit.Alias module to manage unit name aliases which is helpful for user interfaces that use a combination of US spelling and British spelling