Packages
ex_cldr_units
1.0.0-rc.0
3.20.5
3.20.4
3.20.3
3.20.2
3.20.1
3.20.0
3.19.2
3.19.1
3.19.0
3.18.1
3.18.0
3.17.2
3.17.1
3.17.0
3.16.5
3.16.4
3.16.3
3.16.2
3.16.1
3.16.0
3.15.0
3.14.0
3.13.3
3.13.2
3.13.1
3.13.0
3.12.2
3.12.1
3.12.0
3.11.0
3.10.0
3.9.2
3.9.1
3.9.0
3.8.0
3.8.0-rc.2
3.8.0-rc.1
3.8.0-rc.0
3.7.1
3.7.0
3.6.0
3.5.3
3.5.2
3.5.1
3.5.0
3.5.0-rc.1
3.5.0-rc.0
3.4.0
3.4.0-rc.0
3.3.1
3.3.0
3.3.0-rc.0
3.2.1
3.2.0
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
3.0.0-rc.0
2.8.1
2.8.0
2.7.0
2.6.1
2.6.0
2.5.3
2.5.2
2.5.1
2.5.0
2.4.0
2.3.3
2.3.2
retired
2.3.1
2.3.0
2.2.0
2.1.0
2.0.0
1.3.0
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
retired
1.0.1
retired
1.0.0
retired
1.0.0-rc.0
retired
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
Unit formatting (volume, area, length, ...), conversion and arithmetic functions based upon the Common Locale Data Repository (CLDR).
Retired package: Deprecated
Current section
Files
Jump to
Current section
Files
ex_cldr_units
CHANGELOG.md
CHANGELOG.md
# Changelog for Cldr_Units v1.0.0-rc.0
This is the changelog for Cldr_Units v1.0.0-rc.0 released on November 23rd, 2017. For older changelogs please consult the release tag on [GitHub](https://github.com/kipcole9/cldr_units/tags)
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.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