Determine if a string is numeric: Difference between revisions

Content added Content deleted
(add javascript)
(add SQL)
Line 213: Line 213:
<tt>number?</tt> is a standard R5RS scheme predicate
<tt>number?</tt> is a standard R5RS scheme predicate
(define is-numeric? number?)
(define is-numeric? number?)

==[[SQL]]==
[[Category:SQL]]
-- Tested on Microsoft SQL Server 2005

declare @s varchar(10)
set @s = '1234.56'

print isnumeric(@s) --prints 1 if numeric, 0 if not.

if isnumeric(@s)=1 begin print 'Numeric' end
else print 'Non-numeric'


==[[Tcl]]==
==[[Tcl]]==