From 02ac1b3619a42df51369d4174e2f4cfba57d65a0 Mon Sep 17 00:00:00 2001 From: Tom Fryers Date: Wed, 8 Jul 2026 12:57:57 +0100 Subject: [PATCH] Correct unit symbols 'b' means bits, and 'm' is milli, not mega. --- src/try/output.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/try/output.ts b/src/try/output.ts index 2d07673..7bb7522 100644 --- a/src/try/output.ts +++ b/src/try/output.ts @@ -33,9 +33,9 @@ let formatNumberWithDecimal = (value: number): string => { let bytesToText = (bytes: number): string => { if (bytes === 1) return '1 byte' if (bytes < 1024) return formatInteger(bytes) + ' bytes' - if (bytes < 1024 * 1024) return formatNumberWithDecimal(bytes / 1024) + ' kb' - if (bytes < 1024 * 1024 * 1024) return formatNumberWithDecimal(bytes / (1024 * 1024)) + ' mb' - return formatNumberWithDecimal(bytes / (1024 * 1024 * 1024)) + ' gb' + if (bytes < 1024 * 1024) return formatNumberWithDecimal(bytes / 1024) + ' KiB' + if (bytes < 1024 * 1024 * 1024) return formatNumberWithDecimal(bytes / (1024 * 1024)) + ' MiB' + return formatNumberWithDecimal(bytes / (1024 * 1024 * 1024)) + ' GiB' } disableAnnoyingBehaviors(transformOutputEl, true)