diff --git a/Changelog.md b/Changelog.md index 241c1b0..80803e9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,9 @@ Minor refactoring of how the netgraph string is handled. Refactoring of handling of Option types wrapping primitive values. +Round values when determining netgraph results instead of truncating to an +integer. + ## 0.1.5 Implemented `--netdev_width=` which sets the minimum width of the netdev diff --git a/src/proc.rs b/src/proc.rs index 4dd5c14..69bb6e3 100644 --- a/src/proc.rs +++ b/src/proc.rs @@ -143,7 +143,7 @@ impl NetInfo { let graph_value: u8 = if diff_max > graph_max { 8 } else { - (diff_max / graph_max * 8.0f64) as u8 + (diff_max / graph_max * 8.0f64).round() as u8 }; self.graph.remove(0);