Skip to content

Commit

Permalink
avoid having scientific representation of number in formatBytes method
Browse files Browse the repository at this point in the history
  • Loading branch information
danrot committed Apr 5, 2016
1 parent 3290a97 commit 44c391d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CHANGELOG for husky

* dev-develop
* BUGFIX #629 Avoid having scientific representation of number in formatBytes method
* BUGFIX #628 Fixed inheriting font from FontAwesome
* BUGFIX #627 Fixed preselection filtering bug
* BUGFIX #626 Added filtering of preselected items
Expand Down
4 changes: 2 additions & 2 deletions dist/husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -27960,7 +27960,7 @@ define('services/husky/util',[],function() {

/**
* Returns human readable byte string.
*
*
* @param {int} bytes
* @returns {String}
*/
Expand All @@ -27972,7 +27972,7 @@ define('services/husky/util',[],function() {
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));

return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i];
};

Util.getInstance = function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/husky.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions husky_services/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ define(function() {

/**
* Returns human readable byte string.
*
*
* @param {int} bytes
* @returns {String}
*/
Expand All @@ -304,7 +304,7 @@ define(function() {
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));

return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
return (bytes / Math.pow(k, i)).toFixed(2) + ' ' + sizes[i];
};

Util.getInstance = function() {
Expand Down

0 comments on commit 44c391d

Please sign in to comment.