Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/02/2002, 16:23
Avatar de Aleph
Aleph
 
Fecha de Ingreso: agosto-2001
Ubicación: Kenolandia
Mensajes: 1.061
Antigüedad: 23 años, 5 meses
Puntos: 3
Re: Comprobar que una variable contiene un numero

Podes usar dos funciones:

Código:
if (typeof(variable) == "number")
{
...
}
o, tambien:

Código:
if (isNaN(variable)
{
...
}
La primera comprueba si el tipo de objeto es numerico y la otra si no.

<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td align="center"><a href="http://www.cicpm.org" target="_blank"><img src="http://www.amsystems.com.ar/imagenes/fw/firma2.gif" border="0"></a></td></tr></table>