Skip to content

Commit

Permalink
Increase integer size to store 1024^4. Fixes #13
Browse files Browse the repository at this point in the history
Signed-off-by: nachoparker <nacho@ownyourbits.com>
  • Loading branch information
tom-heimbrodt authored and nachoparker committed Oct 22, 2019
1 parent 6352bc6 commit 72344f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dutree"
version = "0.2.12"
version = "0.2.13"
authors = ["nacho <nacho@ownyourbits.com>"]
description = "Command line tool to analyze disk usage"
repository = "https://github.com/nachoparker/dutree"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ fn fmt_size_str( bytes : u64, flag : bool ) -> String {
else if bytes < 1024u64.pow(2) { format!( "{:.2} KiB", b/1024.0 ) }
else if bytes < 1024u64.pow(3) { format!( "{:.2} MiB", b/(1024u32.pow(2) as f32)) }
else if bytes < 1024u64.pow(4) { format!( "{:.2} GiB", b/(1024u32.pow(3) as f32)) }
else { format!( "{:.2} TiB", b/(1024u32.pow(4) as f32)) }
else { format!( "{:.2} TiB", b/(1024u64.pow(4) as f32)) }
}

fn get_bytes( path: &Path, usage_flag : bool ) -> u64 {
Expand Down

1 comment on commit 72344f2

@theAkito
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Please sign in to comment.