Cldr.Unit.Conversion.convert_to_base_unit
You're seeing just the function
convert_to_base_unit
, go back to Cldr.Unit.Conversion module for more information.
Convert a unit into its base unit.
For example, the base unit for length
is meter
. The base unit is an
intermediary unit used in all
conversions.
Arguments
unit
is any unit returned byCldr.Unit.new/2
Returns
unit
converted to its base unit as at:Unit.t()
or{;error, {exception, reason}}
as an error
Example
iex> unit = Cldr.Unit.new!(:kilometer, 10)
iex> Cldr.Unit.Conversion.convert_to_base_unit unit
{:ok, Cldr.Unit.new!(:meter, 10000)}