module::network: Ability to change speed unit text (B/s) #2068
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.
I feel like having
B/s
at the end of the speed value is generally not necessary and takes too much space.This pull request adds a
udspeed-unit
variable to be able to display the unit text in other formats. By default the value isB/s
to keep the old behaviour. The K/M/G suffixes are still hardcoded and are displayed just before the unit.Note: this is a "text-only" feature, setting
speed-unit = "b/s
won't change the output value from bytes per second to bits per second.Examples:
speed-unit = ""
will display speeds like:128
42K
64G
speed-unit = "Bytes/sec"
will display speeds like:128 Bytes/sec
42KBytes/sec
64GBytes/sec