Always use binary byte units

This commit is contained in:
Johannes Zellner
2020-06-02 14:34:38 +02:00
parent 2178dcc963
commit 589ee2d0c5
9 changed files with 35 additions and 33 deletions

View File

@@ -278,29 +278,6 @@ app.filter('prettyDomains', function () {
};
});
// we use 1024 unit in memory limit in manifest
app.filter('prettyMemory', function () {
return function (memory) {
return memory ? Math.floor(memory / 1024 / 1024) : 256;
};
});
// df -H style (si) output
app.filter('prettyMailSize', function () {
return function (size) {
if (!size) return '0 kB';
var i = Math.floor(Math.log(size) / Math.log(1000));
return (size / Math.pow(1000, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; };
});
// df -H style (si) output
app.filter('prettyDiskSize', function () {
return function (size) {
if (!size) return 'Not available yet';
var i = Math.floor(Math.log(size) / Math.log(1000));
return (size / Math.pow(1000, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; };
});
app.filter('installationActive', function () {
return function (app) {
if (app.installationState === ISTATES.ERROR) return false;