Skip to content

Commit

Permalink
Revert RAM numbers back to MB for more accuracy (maybe make this conf…
Browse files Browse the repository at this point in the history
…igurable)
  • Loading branch information
GHaxZ committed Jul 1, 2024
1 parent ddf083c commit 21e51b8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,28 +231,28 @@ 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(),
);

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(),
);
Expand Down

0 comments on commit 21e51b8

Please sign in to comment.