ColdFusion 9.0 Resources |
IsNumericDescriptionDetermines whether a string can be converted to a numeric value. Supports numbers in U.S. number format. For other number support, use LSIsNumeric. Example<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"> <p>Enter a string, and find out whether 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> |