From b63135a0e08ae444c15b9bf5ec0d3f9df11df0ca Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Tue, 3 Mar 2026 09:59:28 -0400 Subject: [PATCH] fix size result --- src/App.vue | 57 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/src/App.vue b/src/App.vue index 06be5e1..25e606c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -149,6 +149,15 @@ function formatItemSize(bytes: number): string { const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; } + +function splitSize(sizeStr: string | number) { + const str = String(sizeStr); + const parts = str.split(' '); + if (parts.length === 2) { + return { value: parts[0], unit: parts[1] }; + } + return { value: str, unit: '' }; +}