import re


def isNumber(test):
    """
    Test if the string is a valid number

    Return the converted number or None if string is not a number.
    """
    try:
        test = str(test)
        if re.search('\.',test):
            try:
                return float(test)
            except:
                return None

        else:
            try:
                return int(test)
            except:
                return None
    except:
        return None