本文实例为大家分享了jquery指定精确小数位的具体代码,供大家参考,具体内容如下
0){
htmlVal = htmlVal.replaceAll("0+?$","");
var len = htmlVal.substring(index+1).length;
if(len > min){
if(len > max){
result = Number(htmlVal).toFixed(max);
result = result.replaceAll("0+?$","");
}else{
result = Number(htmlVal).toFixed(len);
result = result.replaceAll("0+?$","");
}
}else {
result = Number(htmlVal).toFixed(min);
}
}else {
result = Number(htmlVal).toFixed(min);
原文链接:https://www.f2er.com/jquery/41976.html}
$("#"+id).html(result);
}