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 on 2022-03-22 11:04 胜者为王东恺 阅读(1242) 评论(0) 编辑 收藏 举报