August 2001
Intermediate to advanced
976 pages
38h 8m
English
LSIsNumeric
LSIsNumeric(string)Functions identically to the IsNumeric( ) function
within the context of the current locale. Returns
True if string can be
converted to a number in the current locale or
False if it can’t. Here’s an example
that determines whether the supplied values are valid numbers for
each locale:
<CFLOOP INDEX="locale" LIST="#Server.Coldfusion.SupportedLocales#">
<CFSET temp = SetLocale(locale)>
<CFOUTPUT>
<P><B>#locale#</B><BR>
-1: #LSIsNumeric(-1)#<BR>
0: #LSIsNumeric(0)#<BR>
1234: #LSIsNumeric(1234)#<BR>
1,234,567,890: #LSIsNumeric('1,234,567,890')#<BR>
$1234.99: #LSIsNumeric('$1234.99')#<BR>
08/15/1999: #LSIsNumeric('08/15/1999')#<BR>
7pm: #LSIsNumeric('7pm')#<BR>
abcdef: #LSIsNumeric('abcdef')#<BR>
true: #LSIsNumeric(true)#<BR>
false: #LSIsNumeric(false)#<BR>
yes: #LSIsNumeric('yes')#<BR>
no: #LSIsNumeric('no')#<BR>
</CFOUTPUT>
</CFLOOP>Read now
Unlock full access