projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44445a8
)
luci-base: cbi.js: use IEC 80000-13 units to format base 2 byte values
author
Jo-Philipp Wich
<jo@mein.io>
Fri, 8 Oct 2021 18:52:52 +0000
(20:52 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Fri, 8 Oct 2021 18:53:45 +0000
(20:53 +0200)
Fixes: #5354
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 9728e03e120fdcef153a1103065c14f3610fd3bd..aef64d577eb49b2749549f0075a39f2b04c755db 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/cbi.js
@@
-657,7
+657,11
@@
String.prototype.format = function()
for (i = 0; (i < units.length) && (val > mf); i++)
val /= mf;
- subst = (i ? val.toFixed(pr) : val) + units[i];
+ if (i)
+ subst = val.toFixed(pr) + units[i] + (mf == 1024 ? 'i' : '');
+ else
+ subst = val + ' ';
+
pMinLength = null;
break;
}