aboutsummaryrefslogtreecommitdiffstats
path: root/util/human/units.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/human/units.lua')
-rw-r--r--util/human/units.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/human/units.lua b/util/human/units.lua
index 2c4662cd..91d6f0d5 100644
--- a/util/human/units.lua
+++ b/util/human/units.lua
@@ -1,3 +1,5 @@
+local unpack = table.unpack or unpack; --luacheck: ignore 113
+
local large = {
"k", 1000,
"M", 1000000,
@@ -49,7 +51,7 @@ local function format(n, unit, b) --> string
round = math.ceil;
end
local m = math.max(0, math.min(8, round(math.abs(math.log(math.abs(n), logbase)))));
- local prefix, multiplier = table.unpack(prefixes, m * 2-1, m*2);
+ local prefix, multiplier = unpack(prefixes, m * 2-1, m*2);
return fmt:format(n / (multiplier or 1), prefix or "", unit);
end