From 6b8e040443e2f3a249ac317164f7e5ff8ce1404f Mon Sep 17 00:00:00 2001 From: Amy0104 <97265214+Amy0104@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:55:37 +0800 Subject: [PATCH] [Fix][UI] Fix bytesToSize function calculation error. (#10627) (cherry picked from commit a6fc70cdd111a52a1342ff78953f5c3948e8add1) --- dolphinscheduler-ui/src/common/common.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dolphinscheduler-ui/src/common/common.ts b/dolphinscheduler-ui/src/common/common.ts index ae644aeb0..2f5ed4d70 100644 --- a/dolphinscheduler-ui/src/common/common.ts +++ b/dolphinscheduler-ui/src/common/common.ts @@ -46,8 +46,7 @@ export const bytesToSize = (bytes: number) => { const k = 1024 // or 1024 const sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] const i = Math.floor(Math.log(bytes) / Math.log(k)) - - return parseInt((bytes / Math.pow(k, i)).toPrecision(3)) + ' ' + sizes[i] + return parseFloat((bytes / Math.pow(k, i)).toPrecision(3)) + ' ' + sizes[i] } export const fileTypeArr = [ -- GitLab