源文件

This commit is contained in:
gyq
2024-05-23 14:39:33 +08:00
commit a1128dd791
2997 changed files with 500069 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
export function doubleToThousands(amount) {
if(!amount) {
return
}
let numList = amount.toString().split('.')
let num = (numList[0] || 0).toString(), result = '';
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result; }
if(numList[1]) {
return result + '.' + numList[1]
}
if(amount.endsWith('.')) {
return result + '.'
}
return result
}