js实现千分位分割
方法一:
function toThousands(num) {
let [integer, decimal] = String.prototype.split.call(num, '.');
integer = (integer || 0).toString();
let result = '';
while (integer.length > 3) {
result = ',' + integer.slice(-3) + result;
原创
2020-12-10 14:26:40 ·
772 阅读 ·
0 评论