takes a string and grabs the leading number and the following unit 
        both the number and unit returned are simple strings
        returns a triple tuple of (successFlag, number, unit)
        successFlag is False if the number is invalid

def split_number_unit(string, strip_list=None):
    ''' 
        takes a string and grabs the leading number and the following unit 
        both the number and unit returned are simple strings
        returns a triple tuple of (successFlag, number, unit)
        successFlag is False if the number is invalid
    '''
    successFlag = True
    state = 0
    number_so_far = ""
    unit_so_far = ""
    decimal_found = False
    negate_flag = False
    if string is None:
        return (False, "", "")
    string = string.strip()
    if not strip_list:
        strip_list = []
    if len(string):
        if string[0]=="-":
            negate_flag = True
            string = string[1:]
    if len(string):
        if string[0]==".":
            string = "0"+string  # a string of ".12" is actually a legit number, but the lack of a preceding 0 will confuse python, so we tack on a zero
    if len(string):
        for char in string:
            if state==0:  # number state
                if char in ['0','1','2','3','4','5','6','7','8','9']:
                    number_so_far += char
                elif char in strip_list:
                    pass
                elif char==".":
                    if decimal_found:
                        successFlag = False # units do not begin with a period. ex: 234.2.anything 
                        state=2
                    else:
                        number_so_far += char
                        decimal_found = True
                elif char=="\n":
                    state=2
                else:
                    unit_so_far += char
                    state=1
            elif state==1: # unit state
                if char=="\n":
                    state=2
                elif char in strip_list:
                    pass
                else:
                    unit_so_far += char
            else: # discard state
                pass
        # clean up 
        unit_so_far = unit_so_far.strip()
        if len(number_so_far)==0:
            successFlag = False
        if negate_flag:
            number_so_far = "-"+number_so_far
        try:
            number_so_far = decimal.Decimal(number_so_far)
        except:
            successFlag = False
    else:
        successFlag = False
    if not successFlag:
        return(successFlag, "", unit_so_far)
    return (successFlag, number_so_far, unit_so_far)