def __init__(self, value: (str, int, float), precision: int = 2):
        """
        Initialize engineering with units
        :param value: the desired value in the form of a string, int, or float
        :param precision: the number of decimal places
        """
        suffix_keys = [key for key in _suffix_lookup.keys() if key != '']
        self.unit = None

        if isinstance(value, str):
            # parse the string into unit and engineering number
            new_value = ''
            v_index = 0
            for c in value:
                if (c in digits) or (c in ['.', '-']) or (c in suffix_keys):
                    new_value += c
                    v_index += 1
                else:
                    break

            if len(value) >= v_index:
                self.unit = value[v_index:]

            self.eng_num = EngNumber(new_value, precision)

        else:
            self.eng_num = EngNumber(value, precision)
def __init__ ( self , value : ( str , int , float ) , precision : int = 2 ) : suffix_keys = [ key for key in _suffix_lookup . keys ( ) if key != '' ] self . unit = None if isinstance ( value , str ) : new_value = '' v_index = 0 for c in value : if ( c in digits ) or ( c in [ '.' , '-' ] ) or ( c in suffix_keys ) : new_value += c v_index += 1 else : break if len ( value ) >= v_index : self . unit = value [ v_index : ] self . eng_num = EngNumber ( new_value , precision ) else : self . eng_num = EngNumber ( value , precision )
Initialize engineering with units
        :param value: the desired value in the form of a string, int, or float
        :param precision: the number of decimal places