2022年3月22日

js保留几位为小数并去掉小数末尾的0

摘要: var a = 3.1415926;a.toFixed(2); //3.14var b = 3.0001;b.toFixed(2); //3.00如果想去掉0可以用parseFloat方法:parseFloat(b.toFixed(2)); //3 阅读全文

posted @ 2022-03-22 11:04 胜者为王东恺 阅读(1242) 评论(0) 推荐(0) 编辑

导航