method

Float

v2_1_10 - Show latest stable - Class: Kernel
Float(p1)
public

Returns arg converted to a float. Numeric types are converted directly, the rest are converted using arg.to_f. Converting nil generates a TypeError.

Float(1)           #=> 1.0
Float("123.456")   #=> 123.456