格式化成货币数字格式

function formatNumber(number:int):String {
       var piece:String;
       var numString:String = number.toString();
       var result:String = "";
       while (numString.length > 3) {
              piece = numString.substr(-3);
              numString = numString.substr(0, (numString.length - 3));
              result = (("," + piece) + result);
       }
 
       if (numString.length > 0) {
              result = (numString + result);
       }
 
       return (result);
}

你可能感兴趣的:(职场,格式化,货币格式,休闲)