What is the easiest way to find out in Rails 3 whether a string str
contains a positive float number or not ? (str
is not an attribute in an active-record model)
It should work like this:
str = "123" => true
str = "123.456" => true
str = "0" => true
str = "" => false
str = "abcd" => false
str = "-123" => false