def set_type(values, new_type):
    """Convert string values to integers or floats if applicable. Otherwise, return strings.

    If the string value has zero length, none is returned

    Args:
        values: A list of values
        new_type: The type to coerce values to

    Returns:
        The input list of values modified to match their type. String is the default return value. If the values are
        ints or floats, returns the list formatted as a list of ints or floats. Empty values will be replaced with none.
    """
    if new_type == str:
        coerced_values = [str(x) for x in values]
    elif new_type == int or new_type == float:
        float_values = [float(x) for x in values]
        if new_type == int:
            coerced_values = [int(round(x)) for x in float_values]
        else:
            coerced_values = float_values
    else:
        raise ValueError("{} not supported for coercing types".format(new_type.__name__))
    return coerced_values