JavaScript四舍五入保留两位小数

<script type="text/javascript">
  
  var value = 1.1111;
  var result = Math.round(value * 100)/100;
  alert(result);
</script>
 

相关推荐