couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [3/4] fauxton commit: updated refs/heads/master to e799551
Date Thu, 01 Sep 2016 15:09:37 GMT
allow setting amount of decimals

PR: #757
PR-URL: https://github.com/apache/couchdb-fauxton/pull/757
Reviewed-By: Michelle Phung <michellep@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6bd82869
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6bd82869
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6bd82869

Branch: refs/heads/master
Commit: 6bd82869bf9923624112f82d9109b72c1c1cec9f
Parents: e617ad2
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Tue Aug 23 13:10:17 2016 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Sep 1 17:09:18 2016 +0200

----------------------------------------------------------------------
 app/helpers.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6bd82869/app/helpers.js
----------------------------------------------------------------------
diff --git a/app/helpers.js b/app/helpers.js
index 16f56ee..f80a3f0 100644
--- a/app/helpers.js
+++ b/app/helpers.js
@@ -38,7 +38,7 @@ Helpers.getDocUrl = function (key) {
 };
 
 // File size pretty printing, taken from futon.format.js
-Helpers.formatSize = function (size) {
+Helpers.formatSize = function (size, decimals = 1) {
     var jump = 512;
     if (size < jump) return size + " bytes";
     var units = ["KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
@@ -47,7 +47,7 @@ Helpers.formatSize = function (size) {
       i += 1;
       size /= 1024;
     }
-    return size.toFixed(1) + ' ' + units[i - 1];
+    return size.toFixed(decimals) + ' ' + units[i - 1];
   };
 
 Helpers.formatDate = function (timestamp) {


Mime
View raw message