Skip to content

Commit

Permalink
Output Unit "Byte" for tikv-ctl (#3421)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallyard authored and breezewish committed Aug 10, 2018
1 parent b28e09d commit 5cb6355
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bin/tikv-ctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1805,12 +1805,12 @@ fn convert_gbmb(mut bytes: u64) -> String {
const GB: u64 = 1024 * 1024 * 1024;
const MB: u64 = 1024 * 1024;
if bytes < MB {
return bytes.to_string();
return format!("{} B", bytes);
}
let mb = if bytes % GB == 0 {
String::from("")
} else {
format!("{:.3} MB ", (bytes % GB) as f64 / MB as f64)
format!("{:.3} MB", (bytes % GB) as f64 / MB as f64)
};
bytes /= GB;
let gb = if bytes == 0 {
Expand Down

0 comments on commit 5cb6355

Please sign in to comment.