View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > YesNoFormat Previous

YesNoFormat

Evaluates a number or Boolean value.

Yes, for a non-zero value; No, otherwise.

Decision functions, Display and formatting functions

YesNoFormat(value)

IsBinary, IsNumeric

Parameter

Description

value

A number or Boolean value

<h3>YesNoFormat Example</h3>
<p>The YesNoFormat function returns non-zero values as "Yes"; zero values as "No".

<cfoutput>
<ul>
   <li>YesNoFormat(1):   #YesNoFormat(1)#
   <li>YesNoFormat(0):   #YesNoFormat(0)#
   <li>YesNoFormat("1123"):   #YesNoFormat("1123")#
   <li>YesNoFormat("No"):   #YesNoFormat("No")#
   <li>YesNoFormat(True):   #YesNoFormat(True)#
</ul>
</cfoutput>

Contents > CFML Reference > ColdFusion Functions > YesNoFormat Previous

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


Nat Papovich said on Sep 7, 2004 at 10:12 PM :
yesnoformat("") will return "no"

The description says "zero values" are "No", but an empty string might not be considered a "zero value" despite the fact that it the function returns "No" for such a value.
extdw_doc said on Sep 8, 2004 at 10:15 AM :
You are correct. We will correct the description in the next release.
jgibson4 said on Nov 18, 2004 at 5:21 AM :
Using a statement with thisVar containing only 1 or 0 such as:
<cfset attributes.thisVar = YesNoFormat(attributes.thisVar)>
<cfoutput>#attributes.thisVar#</cfoutput>
Does not return Yes or No in the cfoutput. It only returns the original value of 1 or 0. Is there any documentation on this?
jgibson4 said on Nov 18, 2004 at 5:30 AM :
I am using a query set trying to convert a bit field to yes or no. Sorry about the confusion.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/funca129.htm