From f95578e412a76e1694f14b9935bb2e47d121edb9 Mon Sep 17 00:00:00 2001 From: Nate Ding Date: Wed, 1 Jul 2020 20:50:44 +0800 Subject: [PATCH] netspeed format update --- src/Example_Code/example_app.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Example_Code/example_app.c b/src/Example_Code/example_app.c index 8877aa8..8d02452 100644 --- a/src/Example_Code/example_app.c +++ b/src/Example_Code/example_app.c @@ -493,25 +493,25 @@ void testnetspeed(int standalone) if(standalone){ setTextSize(2); setCursor(7,0); - if (in < 1000) sprintf(buf, "U:%d B/s", in); - else if (in > 1000000) sprintf(buf, "U:%.2f M/s", in/1000000.0); - else sprintf(buf, "U:%.2f K/s", in/1000.0); + if (in < 1000) sprintf(buf, "U:%dB/s", in); + else if (in > 1000000) sprintf(buf, "U:%.2fM/s", in/1000000.0); + else sprintf(buf, "U:%.2fK/s", in/1000.0); print_strln(buf); setCursor(7,16); - if (out < 1000) sprintf(buf, "D:%d B/s", out); - else if (out > 1000000) sprintf(buf, "D:%.2f M/s", out/1000000.0); - else sprintf(buf, "D:%.2f K/s", out/1000.0); + if (out < 1000) sprintf(buf, "D:%dB/s", out); + else if (out > 1000000) sprintf(buf, "D:%.2fM/s", out/1000000.0); + else sprintf(buf, "D:%.2fK/s", out/1000.0); print_strln(buf); } else{ setTextSize(1); - if (in < 1000) sprintf(buf, "U:%d B/s,", in); - else if (in > 1000000) sprintf(buf, "U:%.2f M/s,", in/1000000.0); - else sprintf(buf, "U:%.2f K/s,", in/1000.0); + if (in < 1000) sprintf(buf, "U:%dB/s,", in); + else if (in > 1000000) sprintf(buf, "U:%.2fM/s,", in/1000000.0); + else sprintf(buf, "U:%.2fK/s,", in/1000.0); print_str(buf); - if (out < 1000) sprintf(buf, "D:%d B/s", out); - else if (out > 1000000) sprintf(buf, "D:%.2f M/s", out/1000000.0); - else sprintf(buf, "D:%.2f K/s", out/1000.0); + if (out < 1000) sprintf(buf, "D:%dB/s", out); + else if (out > 1000000) sprintf(buf, "D:%.2fM/s", out/1000000.0); + else sprintf(buf, "D:%.2fK/s", out/1000.0); print_str(buf); } }