Localized size units in main.js.
This commit is contained in:
parent
6669337d3a
commit
4b188da546
@ -251,9 +251,12 @@ thead_date.addEventListener('click', e => {
|
||||
});
|
||||
|
||||
|
||||
const size_units = document.getElementsByTagName("html")[0].lang == "ru" ?
|
||||
{"Б": 0, "КиБ": 1, "МиБ": 2, "ГиБ": 3, "ТиБ": 4} :
|
||||
{"B": 0, "KiB": 1, "MiB": 2, "GiB": 3, "TiB": 4};
|
||||
function sizeToBytes(size, unit) {
|
||||
if (units[unit] == 0) return size;
|
||||
for (let i = 0; i <= units[unit]; ++i) size *= 1024;
|
||||
if (size_units[unit] == 0) return size;
|
||||
for (let i = 0; i <= size_units[unit]; ++i) size *= 1024;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user