toFixed(
  int          (可选,默认0)0-20,指定保留几位小数(四舍五入)
)

返回:浮点数





示例:

var n = 2.6789; n.toFixed(1); 结果:"2.7"