TrueFalseFormat
Return Yes/No based on whether the input is true/false
Method Signature
TrueFalseFormat(value=[any])
Arguments
Argument
Type
Required
Description
Default
value
any
true
The value to check for true/false and return Yes/No
Examples
Numeric 1 is interpreted as true
trueFalseFormat( 1 );
Result: true
Numeric 0 is interpreted as false
trueFalseFormat( 0 );
Result: false
String representation of 1 is interpreted as true
trueFalseFormat( "1" );
Result: true
String representation of 0 is interpreted as false
trueFalseFormat( "0" );
Result: false
YES is recognized as synonym for true as well
trueFalseFormat( "YES" );
Result: true
And NO as synonym for false
trueFalseFormat( "NO" );
Result: false
An empty string results in false again
trueFalseFormat( "" );
Result: false
Additional Examples
<bx:output>
False: #trueFalseFormat( false )#<br>
True: #trueFalseFormat( true )#<br>
0: #trueFalseFormat( 0 )#<br>
1: #trueFalseFormat( 1 )#<br>
No: #trueFalseFormat( "No" )#<br>
Yes: #trueFalseFormat( "Yes" )#
</bx:output>
Related
Last updated
Was this helpful?