Skip to content

Commit

Permalink
Merge pull request #281 from butonic/fix_human_filesize_column_header
Browse files Browse the repository at this point in the history
fix human filesize column header
  • Loading branch information
DeepDiver1975 committed Nov 6, 2012
2 parents 8f0269f + c2d6ac5 commit bb40d14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ $.fn.filterAttr = function(attr_name, attr_value) {
function humanFileSize(size) {
var humanList = ['B', 'kB', 'MB', 'GB', 'TB'];
// 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
order = Math.min(humanList.length - 1, order);
var readableFormat = humanList[order];
Expand Down

0 comments on commit bb40d14

Please sign in to comment.