- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
const getSizeString = (size: number) => {
const mesuarments = ["Б", "кБ", "МБ", "ГБ"];
let i = 0;
for (; size/1024 > 1; size /= 1024, i++)
;
return ${Math.floor(size) === size ? size : (size).toFixed(1)} ${mesuarments[i]};
}
Steve_Brown 25.10.2019 14:48 # 0
Her 28.10.2019 12:41 # +2
TOPT 28.10.2019 12:52 # 0