.cs 中如下代码
    public void Mathes()
    {
 double a = 1231.654643;
 double i = Math.Round(a,2);//四舍五入到小数点后两位
 }

JS 中如下代码
   
    <script type="text/javascript">
 function a()
 {
  var num=123.54646;
  alert(num.toFixed(2));
 }
    </script>

<body onLoad="a();">

相关文章: