elixir-cldr / cldr_units

Unit formatting (volume, area, length, ...) functions for the Common Locale Data Repository (CLDR)
Other
16 stars 13 forks source link

fix(Cldr.Unit.compare): Units built from Decimal string value are not compared corrrectly #29

Closed seantanly closed 2 years ago

seantanly commented 2 years ago

The PR fixes the issue Cldr.Unit.compare does not correctly evaluate units that are created from Decimal that is defined from string instead of integer.

Instead of doing a simple comparison of Decimal value, which does a string comparison for above, now it relies on Ratio.compare/2 that is more generic and accurate.

kipcole9 commented 2 years ago

@seantanly, thanks for the PR, much appreciated. Gratefully accepted and will publish an update in the next few hours.

seantanly commented 2 years ago

@kipcole9 Thank you for the fast turn around 👍

kipcole9 commented 2 years ago

Published ex_cldr_units version 3.13.3 with the following changelog entry:

Bug Fixes