Skip to content
Snippets Groups Projects
Commit c2d6ac53 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

fix human filesize column header

parent 8f0269f1
No related branches found
No related tags found
No related merge requests found
...@@ -649,7 +649,7 @@ $.fn.filterAttr = function(attr_name, attr_value) { ...@@ -649,7 +649,7 @@ $.fn.filterAttr = function(attr_name, attr_value) {
function humanFileSize(size) { function humanFileSize(size) {
var humanList = ['B', 'kB', 'MB', 'GB', 'TB']; var humanList = ['B', 'kB', 'MB', 'GB', 'TB'];
// Calculate Log with base 1024: size = 1024 ** order // Calculate Log with base 1024: size = 1024 ** order
var order = Math.floor(Math.log(size) / Math.log(1024)); var order = size?Math.floor(Math.log(size) / Math.log(1024)):0;
// Stay in range of the byte sizes that are defined // Stay in range of the byte sizes that are defined
order = Math.min(humanList.length - 1, order); order = Math.min(humanList.length - 1, order);
var readableFormat = humanList[order]; var readableFormat = humanList[order];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment