标签:color function eal dex == func str substring count
function dealNumberToMoney(money){ var fmtAmt = ""; if(money&&money!=null){ money = money.replace(/,/g,"").replace(/,/g,""); if(money.indexOf(".")==-1){ money = money + ".00"; } var index = money.indexOf("."); var floatValue = money.substring(index+1); var count = 0; for(var i=(index);i>=0;i--){ fmtAmt = money[i]+fmtAmt; if(count==3&&i!=0){ fmtAmt = "," + fmtAmt; count = 0; } count++; } } fmtAmt += floatValue; return fmtAmt; }
标签:color function eal dex == func str substring count
原文地址:https://www.cnblogs.com/jinzhiming/p/9810052.html