fix SI prefixes
- lower 'm' is milli, not mega - lower 'g' is unassigned - 'G' is 10^9, 'Gi' is 2^30 see https://en.wikipedia.org/wiki/Metric_prefix
This commit is contained in:
parent
a878abaa68
commit
2717d15af5
|
@ -159,7 +159,7 @@ local function worker(user_args)
|
|||
{
|
||||
text = math.floor(disks[v].used / 1024 / 1024)
|
||||
.. '/'
|
||||
.. math.floor(disks[v].size / 1024 / 1024) .. 'GB('
|
||||
.. math.floor(disks[v].size / 1024 / 1024) .. 'GiB('
|
||||
.. math.floor(disks[v].perc) .. '%)',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
|
|
|
@ -29,15 +29,15 @@ local function convert_to_h(bytes)
|
|||
dim = 'kb/s'
|
||||
elseif bits < 1000000000 then
|
||||
speed = bits/1000000
|
||||
dim = 'mb/s'
|
||||
dim = 'Mb/s'
|
||||
elseif bits < 1000000000000 then
|
||||
speed = bits/1000000000
|
||||
dim = 'gb/s'
|
||||
dim = 'Gb/s'
|
||||
else
|
||||
speed = tonumber(bits)
|
||||
dim = 'b/s'
|
||||
end
|
||||
return math.floor(speed + 0.5) .. dim
|
||||
return math.floor(speed + 0.5) .. ' ' .. dim
|
||||
end
|
||||
|
||||
local function split(string_to_split, separator)
|
||||
|
|
Loading…
Reference in New Issue