修复小数点,开启审核

This commit is contained in:
huangdeliang
2020-11-14 18:03:19 +08:00
parent 52a7408f49
commit 16b188a375
5 changed files with 41 additions and 39 deletions

View File

@ -155,16 +155,10 @@ export function handleTree(data, id, parentId, children, rootId) {
}
/** 数字逢三位加逗号 */
export function toThousands(num) {
var num = (num || 0).toString(), result = '';
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) {
result = num + result;
}
return result;
export function toThousands(num){
const str = num.toString();
const reg = str.indexOf(".") > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g;
return str.replace(reg,"$1,");
}
export function digitUppercase(n) {