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);
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson