Cldr.Unit.measurement_system-question-mark

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

measurement_system?(unit, system)

View Source (since 3.4.0)

Specs

measurement_system?(t() | unit(), measurement_system() | [measurement_system()]) ::
  boolean() | {:error, {module(), String.t()}}

Returns a boolean indicating if a given unit belongs to one or more measurement systems.

When a list or more than one measurement system is provided, the test is one of inclusion. That is, if the unit belongs to any of the provided measurement systems the return is true.

Arguments

Returns

  • true or false or

  • {:error, {exception, message}}

Examples

iex> Cldr.Unit.measurement_system? :foot, :uksystem
true

iex> Cldr.Unit.measurement_system? :foot, [:uksystem, :ussystem]
true

iex> Cldr.Unit.measurement_system? :foot, [:metric]
false

iex> Cldr.Unit.measurement_system? :invalid, [:metric]
{:error, {Cldr.UnknownUnitError, "The unit :invalid is not known."}}