xieyushi / blog

博客相关文件
5 stars 1 forks source link

JS 截取两位小数 #5

Open xieyushi opened 6 years ago

xieyushi commented 6 years ago

'3432.3499999'.replace(/([0-9]+.[0-9]{2})[0-9]*/,"$1"); 记住前面一定要是字符串,如果是数字。。。是会报错的。。。