Skip to content

Commit

Permalink
Fixed loadavg formatting to always use 2 decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
cederberg committed Dec 30, 2023
1 parent 00bbb75 commit db533b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn cpusummary(sys: &System, fmt: &mut fmt::Format) {
let cores = sys.physical_core_count().unwrap_or(1);
let uptime = sys.uptime();
let loadavg = sys.load_average();
let load = format!("{}, {}, {}", loadavg.one, loadavg.five, loadavg.fifteen);
let load = format!("{:.2}, {:.2}, {:.2}", loadavg.one, loadavg.five, loadavg.fifteen);
let procs = sys.processes().len();
let detail = vec![
format!("up {}", elapsed(uptime)),
Expand Down

0 comments on commit db533b6

Please sign in to comment.