mirror of
https://github.com/streetturtle/awesome-wm-widgets.git
synced 2024-11-15 19:48:04 +01:00
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
2 changed files with 4 additions and 4 deletions
|
@ -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 a new issue