js/utils.js
// Return a human-readable filesize
Return a human-readable filesize
Return a human - readable filesize
function nice_filesize(size) {
        var kb = 1024;         
        var mb = 1024 * kb;    
        var gb = 1024 * mb;    
        var tb = 1024 * gb;    
        if (size < kb)
            return size + ' B';
        else if (size < mb)
            return Math.round(size/kb) + ' KB';
        else if (size < gb)
            return Math.round(size/mb) + ' MB';
        else if (size < tb)
            return Math.round(size/gb) + ' GB';
        else
            return Math.round(size/tb) + ' TB';
    }
function nice_filesize ( size ) { var kb = 1024 ; var mb = 1024 * kb ; var gb = 1024 * mb ; var tb = 1024 * gb ; if ( size < kb ) return size + ' B' ; else if ( size < mb ) return Math . round ( size / kb ) + ' KB' ; else if ( size < gb ) return Math . round ( size / mb ) + ' MB' ; else if ( size < tb ) return Math . round ( size / gb ) + ' GB' ; else return Math . round ( size / tb ) + ' TB' ; }
Return a human-readable filesize
Return a human - readable filesize
// Kilobyte // Megabyte // Gigabyte // Terabyte //  If it's less than a kb we just return the size // Otherwise we keep going until the size is in the appropriate measurement range.