CFLib.org – Common Function Library Project

IsScientific(inNum)

Last updated July 10, 2003

author

Shawn Seley

Version: 2 | Requires: CF5 | Library: MathLib

Description:
Returns true if passed value is formatted in "baseEexp" scientific notation.

Return Values:
Returns a boolean.

Example:

<cfoutput>
IsScientific("9.457382E6"): #IsScientific("9.457382E6")#<br>
IsScientific("6.732E6"): #IsScientific("6.732E6")#<br>
IsScientific("1.23E-3"):#IsScientific("1.23E-3")#<br>
IsScientific("1.0"): #IsScientific("1.0")#<br>
IsScientific("1.23 x 10 -3"):#IsScientific("1.23 x 10 -3")#<br>
</cfoutput>

Parameters:

Name Description Required
inNum Number to check. Yes

Full UDF Source:

/**
 * Returns true if passed value is formatted in &quot;baseEexp&quot; scientific notation.
 * Modified to allow D since versions prior to MX would allow D.
 * 
 * @param inNum      Number to check. (Required)
 * @return Returns a boolean. 
 * @author Shawn Seley (shawnse@aol.com) 
 * @version 2, July 10, 2003 
 */
function IsScientific(inNum) {
    if(IsNumeric(inNum) AND (FindNoCase("E", inNum) OR FindNoCase("D",inNum))) return true;
    else return false;
}

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