js数字四舍五入保留n位小数

num.toFix(n)    把数字四舍五入保留n位小数

var a = 123.789
a.toFixed(2) // 123.79
原文地址:https://www.cnblogs.com/luguankun/p/13224870.html