js中tofixed()方法

toFixed()方法可把number四舍五入为指定小数位数的数字

例子:

var n=parseFloat(input).toFixed(2);

原文地址:https://www.cnblogs.com/mmit/p/14116693.html