From f26e84f67510cf2a24b70c76f2d154e32da768e6 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Fri, 2 Dec 2022 04:03:46 +0000 Subject: [PATCH] fixed a bug in rtt display --- Cargo.toml | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 536ef19..c4d2371 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 = [] diff --git a/src/lib.rs b/src/lib.rs index a3146c8..17d52f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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() } }