参数说明: totalfee:千分位数值 souSym:逗号 , tarSym:空字符串 function replaceSymbol(totalfee,souSym,tarSym) { var tlong = totalfee.length; var i = 0; var j = 0; var k = 0; if(tlong > 0) { for(i=0;i<totalfee.length;i++) { if(totalfee.charAt(i)==souSym) { j++; } } for(k=0;k<j;k++) { totalfee = totalfee.replace(souSym,tarSym); } } else { totalfee = 0.00; } return totalfee; } replaceSymbol(1,234.00,',','') // 1234