authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2022-11-18 10:33:14 -08:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-11-18 10:33:14 -08:00
log5410f8ded9b0ad5379cd153cdcd7512f1db6bfd0
tree961ed9b77809956b9c41f58eff595e5d588bfd39
parentcab8f0eb4859d9c7249020e43af522a5fd43b41d
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

support new SI units


1 files changed, 1 insertions(+), 1 deletions(-)

src/lib.zig+1-1
...@@ -5,7 +5,7 @@ const assert = std.debug.assert;...@@ -5,7 +5,7 @@ const assert = std.debug.assert;
5pub const range = @import("range").range;5pub const range = @import("range").range;
66
7pub fn fmtByteCountIEC(alloc: std.mem.Allocator, b: u64) !string {7pub fn fmtByteCountIEC(alloc: std.mem.Allocator, b: u64) !string {
8 return try reduceNumber(alloc, b, 1024, "B", "KMGTPEZY");8 return try reduceNumber(alloc, b, 1024, "B", "KMGTPEZYRQ");
9}9}
1010
11pub fn reduceNumber(alloc: std.mem.Allocator, input: u64, comptime unit: u64, comptime base: string, comptime prefixes: string) !string {11pub fn reduceNumber(alloc: std.mem.Allocator, input: u64, comptime unit: u64, comptime base: string, comptime prefixes: string) !string {