WrightTools.units.convert

WrightTools.units.convert(val, current_unit, destination_unit)

Convert from one unit to another. If current_unit and/or destination_unit are None, input is returned.

Parameters:
  • val (number) – Number to convert.

  • current_unit (string) – Current unit.

  • destination_unit (string) – Destination unit.

Returns:

Converted value.

Return type:

number