Isnumeric - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

396

IsNumeric

Returns TRUE if string can be converted to a number; otherwise, FALSE.
See also IsBinary.
Syntax
IsNumeric( string )
string
Any string value.
Examples
<!--- 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 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>
</CFIF>
<FORM ACTION="isNumeric.cfm" METHOD="POST">
<P>Enter a string, and discover if
it can be evaluated to a numeric value.
<P><INPUT TYPE="Text" NAME="TheTestValue" VALUE="123">
<INPUT TYPE="Submit" VALUE="Is it a Number?" NAME="">
</FORM>
</BODY>
</HTML>
CFML Language Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents