Round values when determining netgraph output
This commit is contained in:
parent
fb49271a7e
commit
4e8564b596
2 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,9 @@ Minor refactoring of how the netgraph string is handled.
|
||||||
|
|
||||||
Refactoring of handling of Option types wrapping primitive values.
|
Refactoring of handling of Option types wrapping primitive values.
|
||||||
|
|
||||||
|
Round values when determining netgraph results instead of truncating to an
|
||||||
|
integer.
|
||||||
|
|
||||||
## 0.1.5
|
## 0.1.5
|
||||||
|
|
||||||
Implemented `--netdev_width=<width>` which sets the minimum width of the netdev
|
Implemented `--netdev_width=<width>` which sets the minimum width of the netdev
|
||||||
|
|
|
@ -143,7 +143,7 @@ impl NetInfo {
|
||||||
let graph_value: u8 = if diff_max > graph_max {
|
let graph_value: u8 = if diff_max > graph_max {
|
||||||
8
|
8
|
||||||
} else {
|
} else {
|
||||||
(diff_max / graph_max * 8.0f64) as u8
|
(diff_max / graph_max * 8.0f64).round() as u8
|
||||||
};
|
};
|
||||||
|
|
||||||
self.graph.remove(0);
|
self.graph.remove(0);
|
||||||
|
|
Loading…
Reference in a new issue