yesNoFormat

Yes, for a true value; No for a false value, empty string or null. Throws an exception for other values.

yesNoFormat(value) → returns string

Argument Reference

value any
Required

A Boolean value or empty string

Examples
Sample code invoking the yesNoFormat function

Pass in a true value outputs Yes

yesNoFormat(true)

Expected Result: Yes

Pass in a false value outputs No

yesNoFormat(false)

Expected Result: No

Pass in an empty string outputs No

yesNoFormat("")

Expected Result: No

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

Fork me on GitHub