CFLib.org – Common Function Library Project

isFloat(eInt)

Last updated April 22, 2003

author

Phillip Holmes

Version: 1 | Requires: CF5 | Library: MathLib

Description:
IsFloat() determines if a number is a float or whole number. Returns true for float.

Return Values:
Returns a boolean.

Example:

<cfoutput>
isFloat(3.2) = #isFloat(3.2)#<br>
isFloat(3) = #isFloat(3)#<br>
isFloat(3.2apple) = #isFloat("3.2apple")#<br>
</cfoutput>

Parameters:

Name Description Required
eInt Number to check Yes

Full UDF Source:

/**
 * IsFloat() determines if a number is a float or whole number. Returns true for float.
 * Version 2 by RCamden (ray@camdenfamily.com)
 * 
 * @param eInt 	 Number to check (Required)
 * @return Returns a boolean. 
 * @author Phillip Holmes (pholmes@mediares.com) 
 * @version 1, April 22, 2003 
 */
function isFloat(eInt) {
	return (find(".",eInt) gt 0) and isNumeric(eInt);
}
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