fix: fixed numberFormatter bug
https://github.com/PanJiaChen/vue-element-admin/issues/2568
This commit is contained in:
parent
159e21c56b
commit
4342032fb9
|
@ -45,7 +45,7 @@ export function numberFormatter(num, digits) {
|
||||||
]
|
]
|
||||||
for (let i = 0; i < si.length; i++) {
|
for (let i = 0; i < si.length; i++) {
|
||||||
if (num >= si[i].value) {
|
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()
|
return num.toString()
|
||||||
|
|
Loading…
Reference in New Issue