Convert variable to type_integer

type:to_float($variable)

type:to_float(10)
#=> 10.0

type:to_float(0)
#=> 0.0

type:to_float("10.8")
#=> 10.8

type:to_float([])
#=> 0.0

type:to_float([1,2,3])
#=> 1.0

# note: type conversion system tries to find numbers in string!
type:to_float('3.2 bad string')
#=> 3.2

type:to_float(function(){})
#=> Error: type_function could not be converted to float

Copyright ©2013-2022 SunSed®. All rights reserved.