net block: improve throughput formatting#704
Merged
Merged
Conversation
Contributor
|
Wow, i wrote that almost 2 years ago :D Not quite what i'd call beautiful code but it does the job |
Collaborator
Author
|
If you're up for beautifying it then please go ahead! |
Contributor
|
I played around with it for a while and it doesn't actually get a lot better so... meh ¯\_(ツ)_/¯ |
Contributor
|
I wonder if this could be adapted into the speedtest block as well, because the formatting of that one annoys me to the point that i always patch it before updating |
Collaborator
Author
|
I created a new issue for that. By the way do you have any other improvements you'd like to share? (or maybe put your forked repo online?) |
Contributor
|
No, it's really just a hardcoded removal of everything after the decimal points in the speedtest block |
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Mostly?) Resolves #240.
@GladOSkar Thanks for doing the legwork on this one!
This also uncovered a calculation error with
use_bits, which is now fixed.Comparing the new default format (max 3 digits, minimum unit K):
In my opinion this is now way better than before. The only caveat may be when using
use_bitsas in the first example above - perhaps we should display in megabits instead of gigabits for that case. However I will leave that for a future PR.