Only show one decimal place for human mode
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -887,9 +887,17 @@ fn get_meta_from_env() -> HashMap<String,String> {
|
||||
meta_env
|
||||
}
|
||||
|
||||
fn format_size_human_readable(size: u64) -> String {
|
||||
let options = humansize::FormatSizeOptions::from(BINARY)
|
||||
.decimal_places(1);
|
||||
|
||||
humansize::format_size(size, options)
|
||||
}
|
||||
|
||||
|
||||
fn format_size(size: u64, human_readable: bool) -> String {
|
||||
match human_readable {
|
||||
true => humansize::format_size(size, BINARY),
|
||||
true => format_size_human_readable(size),
|
||||
false => size.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user