Function: to_boolean

Function: to_boolean

since 0.3.7


 to_boolean(any value)

Convert any value to a boolean representation.

Normally numbers are not converted to booleans automatically, with the to_boolean function 0 is converted to false while any other number is converted to true.


Parameter Type Description
input any type Value to convert to a boolean.


 to_boolean(true)   == true
 to_boolean("true") == true
 to_boolean(1)      == true
 to_boolean(0)      == false