Skip to content

Commit 97250c8

Browse files
committed
Round up banner numbers to two digits
1 parent ec31b72 commit 97250c8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/util/banner.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ fn format_metric(num: f64, space: &str, suf: &str) -> String {
216216
} else if num >= 1000f64 {
217217
format!("{:.1}{}K{}", num / 1000f64, space, suf)
218218
} else {
219-
format!("{}{}{}", num, space, suf)
219+
// Rounded to two digits, printed without trailing zeroes
220+
let num_rounded = (num * 100.0).round() / 100.0;
221+
format!("{}{}{}", num_rounded, space, suf)
220222
}
221223
}
222224

0 commit comments

Comments
 (0)