From d25dce63c4ab0d208a1bfaa7e55a8a99298f8065 Mon Sep 17 00:00:00 2001 From: Giovanni Pellerano Date: Thu, 10 Aug 2017 20:28:07 +0200 Subject: [PATCH] Fix usage of KiB/MiB in place of kB/MB (#254) --- src/_filter/math/byte-fmt.js | 6 +++--- src/_filter/math/kb-fmt.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/_filter/math/byte-fmt.js b/src/_filter/math/byte-fmt.js index 504dc4f..a1e6bf4 100644 --- a/src/_filter/math/byte-fmt.js +++ b/src/_filter/math/byte-fmt.js @@ -5,13 +5,13 @@ * * @description * Convert bytes into appropriate display - * 1024 bytes => 1 KB + * 1000 bytes => 1 KB */ angular.module('a8m.math.byteFmt', []) .filter('byteFmt', function () { - var compared = [{str: 'B', val: 1024}]; + var compared = [{str: 'B', val: 1000}]; ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'].forEach(function(el, i) { - compared.push({str: el, val: compared[i].val * 1024 }); + compared.push({str: el, val: compared[i].val * 1000 }); }); return function (bytes, decimal) { if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 && diff --git a/src/_filter/math/kb-fmt.js b/src/_filter/math/kb-fmt.js index 96eb70b..256482a 100644 --- a/src/_filter/math/kb-fmt.js +++ b/src/_filter/math/kb-fmt.js @@ -5,13 +5,13 @@ * * @description * Convert bytes into appropriate display - * 1024 kilobytes => 1 MB + * 1000 kilobytes => 1 MB */ angular.module('a8m.math.kbFmt', []) .filter('kbFmt', function () { - var compared = [{str: 'KB', val: 1024}]; + var compared = [{str: 'KB', val: 1000}]; ['MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'].forEach(function(el, i) { - compared.push({str: el, val: compared[i].val * 1024 }); + compared.push({str: el, val: compared[i].val * 1000 }); }); return function (bytes, decimal) { if(isNumber(decimal) && isFinite(decimal) && decimal%1===0 && decimal >= 0 && @@ -23,4 +23,4 @@ angular.module('a8m.math.kbFmt', []) } return 'NaN'; } - }); \ No newline at end of file + });