def convert_to_float(frac_str):
    """
    It wouldn't be the oilfield without a healthy mix of units and fractions.
    This function attempts to deal with fractions care of someone on stack
    overflow (thank you).

    Parameters
    ----------
    frac_str: string

    Returns
    -------
    result: float

    Exceptions
    ----------
    ValueError: if the string is not a number or a fraction
    """
    try:
        return float(frac_str)
    except ValueError:
        num, denom = frac_str.split('/')
        try:
            leading, num = num.split(' ')
            whole = float(leading)
        except ValueError:
            whole = 0
        frac = float(num) / float(denom)
        result = whole - frac if whole < 0 else whole + frac

        return result