`
文章列表
例 sum=parseFloat(8.99)+parseFloat(7.50); 等到值为:16.4900000002 怎么只取到小数点后两位? <script language="JScript"> Number.prototype.toFixed=function(num)    {    //重新构造toFixed方法,IE5.0+    with(Math)this.NO=round(this.valueOf()*pow(10,num))/pow(10,num);    return String(/\./g.exec(this.NO)?this.NO: ...
//判断输入的字符是否是数字、减号、小数点 function funKeyPress(str){ if(event.keyCode==46 && str.length==0)//起始位置不能输入小数点 { alert("输入错误!请输入0--9之间的数字或'-'"); event.returnValue = false; ...
Global site tag (gtag.js) - Google Analytics