vunits.convert.convert_temp

vunits.convert.convert_temp(num, initial, final)

Converts temperature from one unit set to another

Parameters
  • num (float, optional) – Number to convert. I not specified, will return the appropriate conversion factor.

  • initial (str) – Units that num is currently in. Accepted options include ‘C’, ‘oC’, ‘F’, ‘oF’, ‘R’, ‘K’.

  • final (str) – Units you would like num to be in. Accepted options include ‘C’, ‘oC’, ‘F’, ‘oF’, ‘R’, ‘K’.

Returns

conversion_num – num in the appropriate units

Return type

float

Raises

ValueError – If unit types are not consistent or not supported