数字保留2位小数

var num = 3.1415926;
var num = parseFloat(num.toFixed(2));  //toFixed();得到的是一个字符串

原文地址:https://www.cnblogs.com/Zting00/p/7497680.html