function mathPow(val,digit){
var unnum = checknum(val);
if(unnum){
val=0.0;//如果不是数字默认变成0;
}
return Math.round(val*Math.pow(10,digit))/Math.pow(10,digit);
}
function checknum(s){
if(typeof(s)=="number")
return false;
var haserrorChar;
var CorrectChar = "-0123456789."
haserrorChar = isCharsNotInBag(s, CorrectChar);
return haserrorChar;
}
var unnum = checknum(val);
if(unnum){
val=0.0;//如果不是数字默认变成0;
}
return Math.round(val*Math.pow(10,digit))/Math.pow(10,digit);
}
function checknum(s){
if(typeof(s)=="number")
return false;
var haserrorChar;
var CorrectChar = "-0123456789."
haserrorChar = isCharsNotInBag(s, CorrectChar);
return haserrorChar;
}