summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-06-02 11:18:06 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-06-02 11:18:06 +0200
commite2a0af8d5cec219b0de20acf448d16e63f571041 (patch)
tree03fbebcc6d46cca08ad7873ace5e13d4e7e87ea6 /pyload/web/app/scripts
parentadded missing argument (diff)
parentShow correct Value for 'Traffic left' in Accounts View (diff)
downloadpyload-e2a0af8d5cec219b0de20acf448d16e63f571041.tar.xz
Merge pull request #646 from charlie89/fix-accounts-trafficleft
Fix accounts trafficleft
Diffstat (limited to 'pyload/web/app/scripts')
-rw-r--r--pyload/web/app/scripts/helpers/formatSize.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/pyload/web/app/scripts/helpers/formatSize.js b/pyload/web/app/scripts/helpers/formatSize.js
index f72d62158..ddd62a1a5 100644
--- a/pyload/web/app/scripts/helpers/formatSize.js
+++ b/pyload/web/app/scripts/helpers/formatSize.js
@@ -3,7 +3,11 @@ define('helpers/formatSize', ['handlebars', 'utils/i18n'], function(Handlebars,
'use strict';
var sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];
- function formatSize(bytes, options) {
+ function formatSize(bytes, options, multiplier) {
+ //multiplier 1024 is used for trafficleft because trafficleft is in KiB
+ if (typeof multiplier === 'number')
+ bytes = bytes * multiplier;
+
if (!bytes || bytes === 0) return '0 B';
if (bytes === -1)
return i18n.gettext('not available');
@@ -17,4 +21,4 @@ define('helpers/formatSize', ['handlebars', 'utils/i18n'], function(Handlebars,
Handlebars.registerHelper('formatSize', formatSize);
return formatSize;
-}); \ No newline at end of file
+});