Skip to content

Cldr Units version 2.2.0

Compare
Choose a tag to compare
@kipcole9 kipcole9 released this 24 Feb 12:46

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