Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Equal numbers (eng.) can appear both with a decimal separator and w/o: 10 / 10.0 #1857

Closed
dorsiflexion opened this issue Apr 9, 2023 · 4 comments · Fixed by #1858
Closed

Comments

@dorsiflexion
Copy link

Steps to reproduce:
Use net block config (see below) and watch the net block for some time.

Expected behavior:
10 will always be shown as 10.

Actual Behavior:
10 is sometimes displayed as 10 and sometimes as 10.0.

Additional Info:
It is not wrong per se but it is unexpected and weird to look at. It gets annoying if you "allocate" 3 characters for a number (i. e. width 3 and pad with spaces or .eng(w:3)) which is enough in every single case, as far as i observed, except for this one number – 10.0. If it happens and 10.0 is displayed, the entire bar left of it is moved one character to the left, which distracts a lot, because this movement is much more salient than just white numbers changing in one place.

The alternative right now is wasting one character for every number where this can happen which is not great either.

I guess it might has something to do with rounding: 10.0–10.49 is 10 and 9.995–9.9999999… is 10.0?
Or maybe it's something else and 10.0 is just 10.0 and ≥10.1 is 10

Config (net block):

[[block]]
block = "net"
device = "enp5s0"
format = " ^icon_net_down $speed_down.eng(prefix:K, w:3) ^icon_net_up $speed_up.eng(prefix:K, w:3) "
interval = 5

Pics or it didn't happen:
10
10.0
Both numbers appear on both sides, I just don't have a screenshot of both on the same side…

@MaxVerevkin
Copy link
Collaborator

@dorsiflexion this should be fixed in #1858, can you test it?

@dorsiflexion
Copy link
Author

I've now been testing it for maybe 3 hours and have not yet seen the bar move. If I see it move I know this bug just occured and I most likely wouldn't miss that – which means it seems fixed so far.

But l'd say let me test (i. e. use) for another day or two.

@dorsiflexion
Copy link
Author

Yep, I haven't seen it again so far. Seems fixed to me. Thanks a lot!

@dorsiflexion
Copy link
Author

dorsiflexion commented Mar 29, 2024

I don't think this is globally fixed. I just saw 1000KB, when there's also 1.0MB. I was too slow to screenshot the first one, I'm 100% sure though.
The config for that part is still the same as above: format = " ^icon_net_down $speed_down.eng(prefix:K, w:3) ^icon_net_up $speed_up.eng(prefix:K, w:3) "

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants