Skip to content

Commit

Permalink
fixed a bug in rtt display
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed Dec 2, 2022
1 parent 9bc9b04 commit f26e84f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later"
name = "rustyping"
readme = "README.md"
repository = "https://github.com/k4yt3x/rustyping"
version = "2.3.0"
version = "2.3.1"

[features]
unrestricted = []
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ fn paint_rtt(rtt: u128) -> String
// if RTT is less than 1ms, show three digits after the decimal point
if rtt < 1000 {
color
.paint(format!("{:.5}", (rtt as f64 / 1000.0).to_string()))
.paint(format!("{:.3}", rtt as f64 / 1000.0))
.to_string()
}
// if RTT is greater than 1ms, show one digit after the decimal point
else {
color
.paint(format!("{:.4}", (rtt as f64 / 1000.0).to_string()))
.paint(format!("{:.1}", rtt as f64 / 1000.0))
.to_string()
}
}
Expand Down

0 comments on commit f26e84f

Please sign in to comment.