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