fix for pingclock floating point value not being rounded (nilang float rounding is unreliable)
This commit is contained in:
parent
1549b8f368
commit
331844dfd8
1 changed files with 2 additions and 1 deletions
|
@ -23,7 +23,8 @@ proc get_ping(): float =
|
||||||
return ping
|
return ping
|
||||||
|
|
||||||
proc getObject(ping: float): i3barData =
|
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 text = "🏓 " & niceping & " ms"
|
||||||
var col = foreground
|
var col = foreground
|
||||||
if ping < 0:
|
if ping < 0:
|
||||||
|
|
Loading…
Reference in a new issue