Type Conversion functions
These are the functions which are used to convert a data of one type into another.
SRON provides four functions for this:
1. toBool():
{
name : Main
Any val
@ converting 'Int' type to 'Bool', if the value is larger
@ than zero than toBool returns true otherwise false
val = toBool(-12)
println(val)
@ converting 'Double' type to 'Bool', it also work same
@ as double
val = toBool(123.122)
println(val)
val = toBool(0)
println(val)
}OUTPUT:
2. toDouble():
OUTPUT:
3. toInt():
OUTPUT:
4. toString():
OUTPUT:
Last updated