trueFalseFormat

Returns the string true or false when a boolean value is passed in. Throws an exception if the value passed in cannot be converted to a boolean.

trueFalseFormat(value) → returns string

This function requires Lucee. Not supported on Adobe ColdFusion.

trueFalseFormat Argument Reference

value boolean
Required

Examples sample code invoking the trueFalseFormat function

trueFalseFormat(1)

Expected Result: true

trueFalseFormat(0)

Expected Result: false

trueFalseFormat('1')

Expected Result: true

trueFalseFormat('0')

Expected Result: false

trueFalseFormat('YES')

Expected Result: true

trueFalseFormat('NO')

Expected Result: false

trueFalseFormat('')

Expected Result: false


Fork me on GitHub