12345678910111213141516171819 |
- module.exports = {
- formatNumber: function (n) {
- if (isNaN(n)) return 0;
- var out = n;
- if (out >= 100000000) {
- out = (out / 100000000).toFixed(2) + '亿';
- } else if (out >= 10000) {
- out = (out / 10000).toFixed(2) + '万';
- }
- return out
- },
- shenglueh: function (t) {
- if (t.length <= 7) return t
- var li = t.split("")
- li.splice(7);
- li.push("...")
- return li.join("")
- }
- }
|