class Pry::Slop::Option

def value_to_float(value)

Returns the Float value if possible to convert, else a zero.

value - The Object we want to convert to a float.

Convert an object to a Float if possible.
def value_to_float(value)
  if @slop.strict?
    begin
      Float(value.to_s)
    rescue ArgumentError
      raise InvalidArgumentError, "#{value} could not be coerced into Float"
    end
  else
    value.to_s.to_f
  end
end