def cast_nonzero_to_float(val):
    'Cast nonzero number to float; on zero or None, return None'
    if (not val):
        return None
    return float(val)
Cast nonzero number to float; on zero or None, return None
def cast_nonzero_to_float(val):
    
    if (not val):
        return None
    return float(val)