Cldr.Unit.compatible-question-mark

You're seeing just the function compatible-question-mark, go back to Cldr.Unit module for more information.
Link to this function

compatible?(unit_1, unit_2)

View Source

Specs

compatible?(t() | unit(), t() | unit()) :: boolean()

Returns a boolean indicating if two units are of the same unit category.

Arguments

  • unit_1 and unit_2 are any units returned by Cldr.Unit.new/2 or a valid unit name.

Returns

  • true or false

Examples

iex> Cldr.Unit.compatible? :foot, :meter
true

iex> Cldr.Unit.compatible? Cldr.Unit.new!(:foot, 23), :meter
true

iex> Cldr.Unit.compatible? :foot, :liter
false

iex> Cldr.Unit.compatible? "light_year_per_second", "meter_per_gallon"
false