1.只取小数点后两位:
<script>
alert((“156782.1234”).replace(/^(...{2}).$/,”$1”));
</script>
        2.取小数点后的位数:
<script>
alert((“156782.12346”).replace(/(\d.?)/,””).length);
</script>

        3.只取小数点后两位,四舍五入:
<script>
alert(3.1415926.toFixed(3));
</script>


若是要用如:0.22222434 得到 22222434
则应该如下写法,先转换数据类型

function Remove_ZeroDot(NewStr)
{
  NewStr = parseFloat(NewStr).toString(10);
  return NewStr.replace(/(\d
.?)/,””);

}