Function: to_real

Function: to_real

since 0.3.7

Usage

 to_real(any value)

Convert any value to a real number.

Parameters

Parameter Type Description
input any type Value to convert to a real number

Examples

 to_real(1)     == 1.0
 to_real("1.5") == 1.5

Use or else to recover from errors:

 to_number("not a number") or else 0.0  ==  0.0
 to_number("123")          or else 0.0  ==  123.0

See also

to_int Convert any value to a number
to_number Convert any value to a number