From 32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 17 Mar 2026 23:19:43 -0500 Subject: v1.0 --- Hutch/Extensions/Int+ByteFormatting.swift | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Hutch/Extensions/Int+ByteFormatting.swift (limited to 'Hutch/Extensions/Int+ByteFormatting.swift') diff --git a/Hutch/Extensions/Int+ByteFormatting.swift b/Hutch/Extensions/Int+ByteFormatting.swift new file mode 100644 index 0000000..a17ece4 --- /dev/null +++ b/Hutch/Extensions/Int+ByteFormatting.swift @@ -0,0 +1,8 @@ +import Foundation + +extension Int { + /// Human-readable byte size string (e.g. "1.2 MB", "340 KB"). + var formattedByteCount: String { + ByteCountFormatter.string(fromByteCount: Int64(self), countStyle: .file) + } +} -- cgit v1.2.3