toboolean() Function

Converts a value to Boolean.

Syntax

toboolean( value, … )

value: (Any Type) Value to convert.

Returns

Boolean

Notes

A 0 returns false; all other numbers return true.

Strings beginning with t, T, y, Y, or 1 return true; all other strings return false.

When operating on arrays, it is not necessary to use apply with toboolean. If multiple parameters are passed, or one parameter is an Array, then a Boolean Array is returned.

Examples

You can experiment with this function in the test box below.

Test Input

toboolean(0) returns false

toboolean(0,1,0) and toboolean({0,1,0}) both return {false,true,false}

FEEDBACK