Cldr.Unit.BaseUnit.canonical_base_unit-exclamation-mark

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

canonical_base_unit!(unit_string)

View Source

Returns the canonical base unit name for a unit.

The base unit is the common unit through which conversions are passed.

Arguments

  • unit_string is any string representing a unit such as light_year_per_week.

Returns

  • canonical_base_unit or

  • raises an exception

Examples

iex> Cldr.Unit.Parser.canonical_base_unit! "meter"
:meter

iex> Cldr.Unit.Parser.canonical_base_unit! "meter meter"
:square_meter

iex> Cldr.Unit.Parser.canonical_base_unit! "meter per kilogram"
"meter_per_kilogram"

iex> Cldr.Unit.Parser.canonical_base_unit! "yottagram per mile scandinavian"
"kilogram_per_meter"