From 331844dfd8f3dc95eaae007fef7acc5e6251a550 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 21 Mar 2022 16:12:51 +0000 Subject: [PATCH] fix for pingclock floating point value not being rounded (nilang float rounding is unreliable) --- i3bar_pingclock.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i3bar_pingclock.nim b/i3bar_pingclock.nim index 4eaf898..906e10b 100755 --- a/i3bar_pingclock.nim +++ b/i3bar_pingclock.nim @@ -23,7 +23,8 @@ proc get_ping(): float = return ping proc getObject(ping: float): i3barData = - let niceping = $round(ping,1) + let pingstr = split($ping,".") + let niceping = pingstr[0] & "." & pingstr[1][0] var text = "🏓 " & niceping & " ms" var col = foreground if ping < 0: