def validate_err_calc(val):
    """Validation function for the
    :attr:`psy_simple.plotter.FldmeanPlotter.err_calc` formatoption"""
    try:
        val = validate_float(val)
    except (ValueError, TypeError):
        pass
    else:
        if val <= 100 and val >= 0:
            return val
        raise ValueError("Percentiles for the error calculation must lie "
                         "between 0 and 100, not %s" % val)
    try:
        val = ValidateList(float, 2)(val)
    except (ValueError, TypeError):
        pass
    else:
        if all((v <= 100 and v >= 0) for v in val):
            return val
        raise ValueError("Percentiles for the error calculation must lie "
                         "between 0 and 100, not %s" % val)
    try:
        val = validate_str(val)
    except ValueError:
        pass
    else:
        if 'std' not in val:
            raise ValueError(
                'A string for the error calculation must contain std!')
    return val