def METHOD_NAME(a, rel_to):
    '''
    Converts string to integer.
    If string contains "%" it converts it to a float and multiplies by rel_to
    EG: 50% -> 0.5*rel_to
    '''
    if type(a) == int:
        return a
    else:
        if '%' in a:
            return int((int(a.replace('%', '')) / 100) * rel_to)
        else:
            return int(a)