摘要:
利用js的replace方法和正则表达式实现1.先给“582123456.23”添加千分号 var testStr="582123456.23"; var reStr = testStr.replace(/,/g, ""); alert(reStr); //582,123,456.232.在数字比较的时候通常要去除已经存在的千分号 var reStr="582,123,456.23" varregexStr = /(\d{1,3})(?=(\d{3})+(?:$|\.))/g; var resultStr = reStr.replac 阅读全文