Spec-Zone.ru › ColdFusion

booleanFormat

Evaluates the input as a boolean, and outputs either true or false. If not a boolean throws an exception.

booleanFormat(value) → returns string

  • CF2016+
  • Lucee5.1.0+
  • BL 1.0.0+
  • See Also: yesNoFormat isBoolean trueFalseFormat

    Argument Reference

    value numeric
    Required

    Compatibility

    Lucee:

    Version 5.1.0+ Due to Lucee's strict typing, the return value is NOT considered as a boolean

    Examples
    Sample code invoking the booleanFormat function

    1 is definitely true

    booleanFormat(1)

    Expected Result: true

    0 is definitely false

    booleanFormat(0)

    Expected Result: false

    Negative -1 is true as well

    booleanFormat(-1)

    Expected Result: true

    And even a number larger then 1 is true

    booleanFormat(5)

    Expected Result: true

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/booleanformat

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API