diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-06-14 11:10:48 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-06-15 00:22:22 -0700 |
commit | f7e9c0f2ac6d5a80d2719ea0cecfa4ced05216d4 (patch) | |
tree | 4b3d737eb2e756674cade0b163be3432af122647 /server/sonar-web/scripts/utils | |
parent | b33d63ad5fb20e1b25ab377770fd91c6cb8f7cda (diff) | |
download | sonarqube-f7e9c0f2ac6d5a80d2719ea0cecfa4ced05216d4.tar.gz sonarqube-f7e9c0f2ac6d5a80d2719ea0cecfa4ced05216d4.zip |
simplify config of sonar-web
Diffstat (limited to 'server/sonar-web/scripts/utils')
-rw-r--r-- | server/sonar-web/scripts/utils/formatSize.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-web/scripts/utils/formatSize.js b/server/sonar-web/scripts/utils/formatSize.js index 384f686866f..e06ba0e183f 100644 --- a/server/sonar-web/scripts/utils/formatSize.js +++ b/server/sonar-web/scripts/utils/formatSize.js @@ -17,12 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -module.exports = function (bytes) { - if (bytes == 0) { +module.exports = function(bytes) { + if (bytes === 0) { return '0'; } - var k = 1000; // or 1024 for binary - var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; - var i = Math.floor(Math.log(bytes) / Math.log(k)); + const k = 1000; // or 1024 for binary + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + const i = Math.floor(Math.log(bytes) / Math.log(k)); return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]; }; |