mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
Add new file base system stats and MCI codes
This commit is contained in:
parent
1c2926fbe9
commit
3980c8acae
5 changed files with 91 additions and 4 deletions
|
@ -326,9 +326,7 @@ function formatByteSizeAbbr(byteSize) {
|
|||
return SIZE_ABBRS[Math.floor(Math.log(byteSize) / Math.log(1024))];
|
||||
}
|
||||
|
||||
function formatByteSize(byteSize, withAbbr, decimals) {
|
||||
withAbbr = withAbbr || false;
|
||||
decimals = decimals || 3;
|
||||
function formatByteSize(byteSize, withAbbr = false, decimals = 2) {
|
||||
const i = 0 === byteSize ? byteSize : Math.floor(Math.log(byteSize) / Math.log(1024));
|
||||
let result = parseFloat((byteSize / Math.pow(1024, i)).toFixed(decimals));
|
||||
if(withAbbr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue