//true 非浮点,false 浮点
isNotFloat=(theFloat)=>
{
if(theFloat){
theFloat=theFloat.trim();
}else{
return true;
}
//判断是否为浮点数
let len=theFloat.length;
let dotNum=0;
if (len==0)
return true;
for(let i=0;i<len;i++){
let oneNum=theFloat.substring(i,i+1);
if(i==0&&oneNum=="-"){
continue;
}
if (oneNum==".")
dotNum++;
if ( ((oneNum<"0" || oneNum>"9") && oneNum!=".") || dotNum>1)
return true;
}
if (len>1 && theFloat.substring(0,1)=="0"){
if (theFloat.substring(1,2)!=".")
return true;
}
return false;
}