Cldr.Unit.Math.compare
You're seeing just the function
compare
, go back to Cldr.Unit.Math module for more information.
Compare two units, converting to a common unit type if required.
If conversion is performed, the results are both rounded to a single decimal place before comparison.
Returns :gt
, :lt
, or :eq
.
Example
iex> x = Cldr.Unit.new!(:kilometer, 1)
iex> y = Cldr.Unit.new!(:meter, 1000)
iex> Cldr.Unit.Math.compare x, y
:eq