From 21e51b8c6342f44cc13328a58f21812f93a445ed Mon Sep 17 00:00:00 2001 From: GHaxZ Date: Mon, 1 Jul 2024 22:16:00 +0200 Subject: [PATCH] Revert RAM numbers back to MB for more accuracy (maybe make this configurable) --- src/model.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/model.rs b/src/model.rs index b7ef2bc..ac509d7 100644 --- a/src/model.rs +++ b/src/model.rs @@ -231,18 +231,18 @@ impl Display for SystemInfo { str.push_str( format!( - "\n{}: {}GB", + "\n{}: {}MB", "RAM".with(color).bold(), - self.ram_total / 1_000_000_000 + self.ram_total / 1_000_000 ) .as_str(), ); str.push_str( format!( - "\n{}: {}GB - {:.1}%", - "├─ Used".with(color).bold(), - self.ram_used / 1_000_000_000, + "\n{}: {}MB - {:.1}%", + "├ Used".with(color).bold(), + self.ram_used / 1_000_000, (self.ram_used as f64 / self.ram_total as f64) * 100.0 ) .as_str(), @@ -250,9 +250,9 @@ impl Display for SystemInfo { str.push_str( format!( - "\n{}: {}GB", - "└─ Swap".with(color).bold(), - self.ram_swap / 1_000_000_000 + "\n{}: {}MB", + "└ Swap".with(color).bold(), + self.ram_swap / 1_000_000 ) .as_str(), );