luci-base: cbi.js: use IEC 80000-13 units to format base 2 byte values
Fixes: #5354 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
44445a8097
commit
0a31efc858
1 changed files with 5 additions and 1 deletions
|
@ -657,7 +657,11 @@ String.prototype.format = function()
|
||||||
for (i = 0; (i < units.length) && (val > mf); i++)
|
for (i = 0; (i < units.length) && (val > mf); i++)
|
||||||
val /= mf;
|
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;
|
pMinLength = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue