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, etc.

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

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub