def _value_to_numeric(value):
    """Convert a value string to a number.

    Parameters
    ----------
    value : str
        Parameter value as a string.

    Raises
    ------
    ValueError
        If the string cannot be converted.

    Returns
    -------
    number
        The value converted to ``int`` or ``float``.
    """
    try:
        return int(value)
    except ValueError:
        return float(value)