def parse_num(str):
    """parse from str to float number.
    
    ie. '12.34 %' --> 0.1234
    ie. '123,456.789' --> 123456.789
    ie. '' --> 0
    ie. '12.34' --> 12.34
    """
    if "%" in str:
        return float(''.join(str.split('%'))) / 100.
    elif ',' in str:
        return float(''.join(str.split(',')))
    elif str == '':
        return 0
    else:
        return float(str)