From 2322feb5b7dbdc36172efe90d7eed7ea658434dd Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu@web.de> Date: Tue, 5 Mar 2019 11:59:16 +0100 Subject: [PATCH] Fix memory display --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 86babe5..adade9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,5 +11,5 @@ fn main() { let mut meminfo = meminfo.split('\n'); let total = meminfo.next().unwrap().split_whitespace().nth(1).unwrap().parse::().unwrap() / 1_000; let available = meminfo.nth(1).unwrap().split_whitespace().nth(1).unwrap().parse::().unwrap() / 1_000; - println!("{:.1}% {:.1}°C {}/{}MB", load / num_cpus * 100.0, temp, available, total); + println!("{:.1}% {:.1}°C {}/{}MB", load / num_cpus * 100.0, temp, total - available, total); }