def sfloat(S):
    """Convert a string to float. An empty field or a unconvertable value is treated as zero"""
    if S.strip():
        try:
            return float(S)
        except ValueError:
            pass
    return 0.0
