Ruby program to convert the string into a floating-point number
str = "10.5";
result = str.to_f();
print "Result: ",result;
Output:
Result: 10.5
str = "10.5";
result = str.to_f();
print "Result: ",result;
Output:
Result: 10.5