function validate(num)
{
 

var reg = /^\d+(?=\.{0,1}\d+$|$)/
  if(reg.test(num)) return true;
  return false ;  
}

相关文章: