最近在研究 nestjs,关于 nestjs 上传文件比较疑惑,不知道该如何使用,这里介绍下 nestjs 如何上传文件的。这里将学会如下: 1、学会上传一个文件2、同时上传...
最近在研究 nestjs,关于 nestjs 上传文件比较疑惑,不知道该如何使用,这里介绍下 nestjs 如何上传文件的。这里将学会如下: 1、学会上传一个文件2、同时上传...
辣鸡文章
感谢楼主的分享,我在你的基础上加了一个负数的千分位
/**/
Number.prototype.thousandSeparatorFormatter = function (dotLength) {
/*
* dotLength 小数点长度 默认不处理
* */
let symbol = '';
let _this = this.toString()
.split('.');
if(_this[0].match('-')){
symbol = '-'
_this[0] = _this[0].slice(1,)
}
if(dotLength && _this[1]){
/*默认不处理小数点*/
_this[1] = _this[1].slice(0,dotLength)
}
let arr = _this[0].split('')
.reverse();
let result = [];
for (var i = 0; i < arr.length; i++) {
if (i % 3 === 0 && i !== 0) {
result.push(',');
}
result.push(arr[i]);
}
result.reverse();
if (_this[1]) {
result = result.join('')
.concat('.' + _this[1]);
} else {
result = result.join('');
}
return symbol+result;
};
千分位分隔符js
2020年12月8日更新 亲测有效(ps: 最近工作有点忙,公众号自取,文章底部关注公众号不迷路😇😇😇)2U809ZBOLI-eyJsaWNlbnNlSWQiOiIyVTgw...