trueFalseFormat

True, for a non-zero value; False, otherwise

trueFalseFormat(value) → returns string

This function requires Lucee. Not supported on Adobe ColdFusion.

trueFalseFormat Argument Reference

value any
Required

Examples sample code invoking the trueFalseFormat function


Numeric 1 is interpreted as true

trueFalseFormat(1)

Expected Result: true


Numeric 0 is interpreted as false

trueFalseFormat(0)

Expected Result: false


String representation of 1 is interpreted as true

trueFalseFormat('1')

Expected Result: true


String representation of 0 is interpreted as false

trueFalseFormat('0')

Expected Result: false


YES is recognized as synonym for true as well

trueFalseFormat('YES')

Expected Result: true


And NO as synonym for false

trueFalseFormat('NO')

Expected Result: false


An empty string results in false again

trueFalseFormat('')

Expected Result: false


Fork me on GitHub