def _convert_num(s):
    """Convert a numeric string to a number.

    Args:
        s (str): A number representing a string

    Returns:
        int or float: The numeric representation of the string

    """
    try:
        return int(s)
    except ValueError:
        return float(s)