def __extract_digits__(string):
    """
        Extracts digits from beginning of string up until first non-diget character

        Parameters
        -----------------
        string : string
            Measurement string contain some digits and units


        Returns
        -----------------
        digits : int
            Digits at start of string
    """
    
    i = 0
    
    while string[i].isdigit():
        i += 1
    
    return int(string[0:i])