470
IsNumeric
Description
Returns TRUE if string can be converted to a number; otherwise, FALSE. Supports
numbers in U.S. number format. For international number support, use
LSIsNumeric
Category
Decision functions
IsNumeric(string)
Syntax
See also
IsBinary
Parameters
Parameter
string
Example
<!--- This example shows the use of IsNumeric --->
<html>
<head>
<title>IsNumeric Example</title>
</head>
<body bgcolor = silver>
<H3>IsNumeric Example</H3>
<cfif IsDefined("FORM.theTestValue")>
</cfif>
<form action = "isNumeric.cfm" method = "POST">
<P>Enter a string, and discover if it can be evaluated to a numeric
<P><input type = "Text" name = "TheTestValue" value = "123">
<input type = "Submit" value = "Is it a Number?" name = "">
</FORM>
</body>
</html>
.
Description
A string value
<cfif IsNumeric(FORM.theTestValue)>
<H3>The string <cfoutput>#DE(FORM.theTestValue)#</cfoutput>
can be converted to a number</H3>
<cfelse>
<H3>The string <cfoutput>#DE(FORM.theTestValue)#</cfoutput>
cannot be converted to a number</H3>
</cfif>
value.
Chapter 3 ColdFusion Functions
Need help?
Do you have a question about the COLDFUSION 5 - CFML and is the answer not in the manual?