clearNoNum(form,val,text){
//修復(fù)第一個字符是小數(shù)點(diǎn) 的情況.
? ? if (this[form][val][text] !='' &&this[form][val][text].substr(0,1) =='.') {
this[form][val][text] ="";
}
this[form][val][text] =this[form][val][text].replace(/^0*(0\.|[1-9])/,'$1');//解決 粘貼不生效
? ? this[form][val][text] =this[form][val][text].replace(/[^-\d.]/g,"");//清除“數(shù)字”和“.”以外的字符
? ? this[form][val][text] =this[form][val][text].replace(/\.{2,}/g,".");//只保留第一個. 清除多余的
? ? this[form][val][text] =this[form][val][text].replace(".","$#$").replace(/\./g,"").replace("$#$",".");
this[form][val][text] =this[form][val][text].replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能輸入兩個小數(shù)
? ? if (this[form][val][text].indexOf(".") <0 &&this[form][val][text] !="") {//以上已經(jīng)過濾四敞,此處控制的是如果沒有小數(shù)點(diǎn)慈俯,首位不能為類似于 01顽素、02的金額
? ? ? ? if (this[form][val][text].substr(0,1) =='0' &&this[form][val][text].length ==2) {
this[form][val][text] =this[form][val][text].substr(1,this[form][val][text].length);
}
}
},