Name

boolean — Converts the input value into a boolean value.

Syntax

boolean(integer)
boolean(number)
boolean(string)
                

The BOOLEAN function has the following arguments:

integer

The integer value which you want to convert to a boolean

number

The double value which you want to convert to a boolean

string

The boolean value which you want to convert to a boolean

Description

The boolean function will convert the input value to a boolean.

If the input is an integer or number type then the value if the value equals 0 then a false value is returned, otherwise true.

If the input is a string value the function will return true if the case insensitive string is 'true', and false otherwise.

If the input is a boolean then the value is returned unchanged

Examples

Formula

Description

Result

boolean(34.66)

Boolean value of double precision number 34.66

true

boolean(0)Boolean value of integer 0false
boolean('true')Boolean value of 'true'true
boolean('tRUe')Boolean value of 'tRUe'true
boolean('truth')Boolean value of 'truth'false
boolean('t')Boolean value of 't'false