bool

Syntax

bool bool(value)

Parameters

Returns

A boolean value calculated from value.

Description

This function converts value to the corresponding boolean value. Float values are false if they are equal to 0, true otherwise. Strings are false if equal to "f", "false", "0", 0.0" etc, true otherwise.

Related

Examples

bool(1)
# result = true	

bool(0)
# result = false	

bool("1")
# result = true	

bool(6.66)
# result = true

bool("false")
# result = false	

bool("f")
# result = false	

bool("true")
# result = true	

bool("beneath the remains")
# result = true

bool(11.5 == 0)
# result = false	
	

Copyright ©2008-2024 Esri R&D Center Zurich. All rights reserved.