nqrduck.helpers.unitconverter#

Helper used for unit conversion.

Classes

UnitConverter()

This class provides methods for unit conversion.

class nqrduck.helpers.unitconverter.UnitConverter#

This class provides methods for unit conversion.

classmethod to_decimal(value: str) Decimal#

This method checks if the last character of the string is a suffix.

The available suffixes are: - n for nano - u for micro - m for milli

Parameters:

value (str) – The value to be converted

Returns:

The converted value

Return type:

decimal.Decimal

classmethod to_float(value: str) float#

This method checks if the last character of the string is a suffix.

The available suffixes are: - n for nano - u for micro - m for milli

Parameters:

value (str) – The value to be converted

Returns:

The converted value

Return type:

float