Skip to content

Commit 5ab9d8f

Browse files
committed
fix for issue #161
1 parent 8ce378c commit 5ab9d8f

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ heim = { git = "https://github.com/bvaisvil/heim.git", branch = "zenith_changes"
2929
futures = "0.3.31"
3030
gumdrop = { version = "~0.8.1", features = ["default_expr"] }
3131
chrono = "~0.4.39"
32-
sysinfo = { git = "https://github.com/bvaisvil/sysinfo.git", branch = "zenith_changes_15.1" }
32+
sysinfo = { git = "https://github.com/bvaisvil/sysinfo.git", branch = "zenith_changes_15.1_mem_fix" }
3333
dirs-next = "2.0.0"
3434
serde = { version = "~1.0.217", features = ["derive"] }
3535
serde_derive = "~1.0.217"

src/renderer/cpu.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ fn mem_title(app: &'_ CPUTimeApp) -> Line<'_> {
109109
Span::styled(
110110
format!(
111111
"{} / {} - {:}%",
112-
float_to_byte_string!(app.mem_utilization as f64, Unit::KB),
113-
float_to_byte_string!(app.mem_total as f64, Unit::KB),
112+
float_to_byte_string!(app.mem_utilization as f64, Unit::B),
113+
float_to_byte_string!(app.mem_total as f64, Unit::B),
114114
mem
115115
),
116116
if mem > 95 { max_style() } else { ok_style() },
@@ -119,8 +119,8 @@ fn mem_title(app: &'_ CPUTimeApp) -> Line<'_> {
119119
Span::styled(
120120
format!(
121121
"{} / {} - {:}%",
122-
float_to_byte_string!(app.swap_utilization as f64, Unit::KB),
123-
float_to_byte_string!(app.swap_total as f64, Unit::KB),
122+
float_to_byte_string!(app.swap_utilization as f64, Unit::B),
123+
float_to_byte_string!(app.swap_total as f64, Unit::B),
124124
swp,
125125
),
126126
if swp > 20 { max_style() } else { ok_style() },

src/renderer/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ macro_rules! float_to_byte_string {
77
match Byte::from_f64_with_unit($x, $unit) {
88
Some(b) => format!(
99
"{:.2}",
10-
b.get_appropriate_unit(byte_unit::UnitType::Decimal)
10+
b.get_appropriate_unit(byte_unit::UnitType::Binary)
1111
)
12-
.replace(" ", ""),
12+
.replace(" ", "").replace("iB", ""),
1313
None => String::from("Err"),
1414
}
1515
};

0 commit comments

Comments
 (0)