Always use binary byte units
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user