CFLib.org – Common Function Library Project

trueFalseToInt(value)

Last updated August 6, 2004

author

Cory Toth

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Simple function to format a true / false value to an integer (true=1, false=0). All Values passed to function that are not equal to "true" will be return 0

Return Values:
Returns an integer.

Example:

<cfoutput>
#trueFalseToInt("true")#
</cfoutput>

Parameters:

Name Description Required
value Value to check. Yes

Full UDF Source:

/**
 * Simple function to format a true / false value to an integer (true=1, false=0).
 * 
 * @param value 	 Value to check. (Required)
 * @return Returns an integer. 
 * @author Cory Toth (ctoth@tmctech.com) 
 * @version 1, August 6, 2004 
 */
function trueFalseToInt(value){
	return iif(value, 1, 0);
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson