1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-04-05 19:41:51 +08:00

fix: fixed numberFormatter bug

https://github.com/PanJiaChen/vue-element-admin/issues/2568
This commit is contained in:
花裤衩 2019-09-30 15:06:42 +08:00
parent 0e9ce78b8a
commit 8235011665

View File

@ -45,7 +45,7 @@ export function numberFormatter(num, digits) {
]
for (let i = 0; i < si.length; i++) {
if (num >= si[i].value) {
return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
return (num / si[i].value).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
}
}
return num.toString()