UnitInfo¶
UnitInfo¶
- class UnitInfo¶
UnitInfo provides functions to retrieve information concerning unit definitions
- Convert(value, srcUnit, dstUnit)¶
Converts the given value from a source unit into the destination unit
Info
A unitless size (noUnit) cannot be converted.
- GetDimension(unitString)¶
Provides the dimension of a unit
- Parameters:
- unitString : str¶
Name of unit
- Returns:
Dimension or None if unit unknown
- Return type:
str or None
- HasUnit(unitString)¶
Checks whether the unit is defined in the units definition file
- Parameters:
- unitString : str¶
Name of unit
- Returns:
True or False
- Return type:
bool