From b08a52719940a4d7693404f84bc61f6df7403824 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 27 Jul 2021 21:55:05 +0200 Subject: [PATCH] file size only one decimal --- src/functions/sizeToReadable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/sizeToReadable.ts b/src/functions/sizeToReadable.ts index f25b56c..0a3df26 100644 --- a/src/functions/sizeToReadable.ts +++ b/src/functions/sizeToReadable.ts @@ -1,6 +1,6 @@ function sizeToReadable(size: number): string { const i = Math.floor(Math.log(size) / Math.log(1024)) - return (size / Math.pow(1024, i)).toFixed(2) + " " + ["B", "kB", "MB", "GB", "TB"][i] + return (size / Math.pow(1024, i)).toFixed(1) + " " + ["B", "kB", "MB", "GB", "TB"][i] }