$格式化 revenue
Posted cylblogs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了$格式化 revenue相关的知识,希望对你有一定的参考价值。
Number.prototype.formatMoney = function (places, symbol, thousand, decimal) {
places = !isNaN(places = Math.abs(places)) ? places : 2;
symbol = symbol !== undefined ? symbol : "$";
thousand = thousand || ",";
decimal = decimal || ".";
var number = this,
negative = number < 0 ? "-" : "",
i = parseInt(number = Math.abs(+number || 0).toFixed(places), 10) + "",
j = (j = i.length) > 3 ? j % 3 : 0;
return symbol + negative + (j ? i.substr(0, j) + thousand : "") + i.substr(j).replace(/(d{3})(?=d)/g, "$1" + thousand) + (places ? decimal + Math.abs(number - i).toFixed(places).slice(2) : "");
};
以上是关于$格式化 revenue的主要内容,如果未能解决你的问题,请参考以下文章