Skip to content

Commit

Permalink
Enable pretty format for petabyte data
Browse files Browse the repository at this point in the history
  • Loading branch information
janbridley authored and bootandy committed Nov 8, 2024
1 parent 1d40ca0 commit 7c9e2f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::iter::repeat;
use std::path::Path;
use thousands::Separable;

pub static UNITS: [char; 4] = ['T', 'G', 'M', 'K'];
pub static UNITS: [char; 5] = ['P', 'T', 'G', 'M', 'K'];
static BLOCKS: [char; 5] = ['█', '▓', '▒', '░', ' '];
const FILETIME_SHOW_LENGTH: usize = 19;

Expand Down Expand Up @@ -566,6 +566,8 @@ mod tests {
assert_eq!(human_readable_number(1024 * 1024 * 1024 - 1, ""), "1023M");
assert_eq!(human_readable_number(1024 * 1024 * 1024 * 20, ""), "20G");
assert_eq!(human_readable_number(1024 * 1024 * 1024 * 1024, ""), "1.0T");
assert_eq!(human_readable_number(1024 * 1024 * 1024 * 1024 * 234, ""), "234T");
assert_eq!(human_readable_number(1024 * 1024 * 1024 * 1024 * 1024, ""), "1.0P");
}

#[test]
Expand Down

0 comments on commit 7c9e2f1

Please sign in to comment.