Skip to content

Releases: elixir-cldr/cldr_units

Cldr Units version 2.5.2

20 Aug 23:30
Compare
Choose a tag to compare

Bug Fixes

  • Replace Cldr.get_current_locale/0 with Cldr.get_locale/0in docs

  • Fix dialyzer warnings

Cldr Units version 2.5.1

18 Jun 15:53
Compare
Choose a tag to compare

Enhancements

  • Standardize the development cldr backend as MyApp.Cldr which makes for more understandable and readable examples and doc tests

  • Cldr.Unit.to_string/3 now allows for the backend parameter to default to Cldr.default_backend/0

  • Correct the implementation of option :style that is other than :long

Cldr Units version 2.5.0

28 Mar 11:22
Compare
Choose a tag to compare

Enhancements

Cldr Units version 2.4.0

23 Mar 07:16
Compare
Choose a tag to compare

Enhancements

  • Supports Cldr.default_backend() as a default for backend parameters in Cldr.Unit

Cldr Units version 2.3.2

20 Mar 04:37
Compare
Choose a tag to compare

Bug Fixes

  • Fix dialyzer warnings

Cldr Units version 2.3.1

15 Mar 16:18
Compare
Choose a tag to compare

Enhancements

  • Makes generation of documentation for backend modules optional. This is implemented by the :generate_docs option to the backend configuration. The default is true. For example:
defmodule MyApp.Cldr do
  use Cldr,
    default_locale: "en-001",
    locales: ["en", "ja"],
    gettext: MyApp.Gettext,
    generate_docs: false
end

Cldr Units version 2.3.0

04 Mar 05:37
Compare
Choose a tag to compare

Enhancements

  • The conversion tables are now stored as json and updates may be downloaded at any time with the mix task mix cldr.unit.download. This means that updates to the conversion table may be made without requiring a new release of Cldr.Unit.

Cldr Units version 2.2.0

24 Feb 12:46
Compare
Choose a tag to compare

Enhancements

This release is primarily about improving the conversion of units without introducing precision errors that accumulate for floats. The strategy is to define the conversion value between individual unit pairs.

Currently the implementation uses a static map. In order to give users a better experience a future release will allow for both specifying mappings as a parameter to Cldr.Unit.convert/2 and as compile time configuration options including the option to download conversion tables from the internet.

  • Direct conversions are now supported. For some calculations, the process of diving and multiplying by conversion factors produces an unexpected result. Some direct conversions are now defined which produce a more expected result.

  • In most cases, return integer values from conversion and decomposition when the originating unit value is also an integer

Cldr Units version 2.1.0

08 Dec 07:55
Compare
Choose a tag to compare

Enhancements

  • Add Cldr.Unit.Conversion.convert!/3

  • Add Cldr.Unit.Math.cmp/2

  • Add Cldr.Unit.decompose/2

  • Add Cldr.Unit.zero/1

  • Add Cldr.Unit.zero?/1

The appropriate backend equivalents are also added.

Cldr Units version 2.0.0

24 Nov 06:23
Compare
Choose a tag to compare

Breaking changes

  • Cldr.Unit now requires a Cldr backend module to be configured

  • In order for the String.Chars protocol to be supported (which is used in string interpolation and by Kernel.to_string/1) a default backend must be configured. For example in config.exs:

config :ex_cldr_units,
  default_backend: MyApp.Cldr

Enhancements

  • Move to a backend module structure with ex_cldr version 2.0