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>
(cherry picked from commit 0a31efc858
)
This commit is contained in:
parent
850fcaf0b9
commit
32fc8941b8
1 changed files with 5 additions and 1 deletions
|
@ -646,7 +646,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue