From 4342032fb907582fd84626a8aec5345dcc6439f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Mon, 30 Sep 2019 15:06:42 +0800 Subject: [PATCH] fix: fixed numberFormatter bug https://github.com/PanJiaChen/vue-element-admin/issues/2568 --- src/filters/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters/index.js b/src/filters/index.js index f6a28488..98222339 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -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()