until.wxs 426 B

12345678910111213141516171819
  1. module.exports = {
  2. formatNumber: function (n) {
  3. if (isNaN(n)) return 0;
  4. var out = n;
  5. if (out >= 100000000) {
  6. out = (out / 100000000).toFixed(2) + '亿';
  7. } else if (out >= 10000) {
  8. out = (out / 10000).toFixed(2) + '万';
  9. }
  10. return out
  11. },
  12. shenglueh: function (t) {
  13. if (t.length <= 7) return t
  14. var li = t.split("")
  15. li.splice(7);
  16. li.push("...")
  17. return li.join("")
  18. }
  19. }