def do_float(value, default=0.0):
 try:
  return float(value)
 except (TypeError, ValueError):
  return default

def do_float ( value , default = 0.0 ) : try : return float ( value ) except ( TypeError , ValueError ) : return default
convert the value into a floating point number .