Fix wrong display in memory and swap

This commit is contained in:
Alessio Sergi 2014-05-07 17:27:00 +02:00
parent 3687321b30
commit 6c3ea7f293
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ class Plugin(GlancesPlugin):
msg = "{0:5} ".format(_("MEM"))
ret.append(self.curse_add_line(msg, "TITLE"))
# Percent memory usage
msg = "{0:>6}%".format(format(self.stats['percent'] / 100, '.1'))
msg = "{0:>7.1%}".format(self.stats['percent'] / 100)
ret.append(self.curse_add_line(msg))
# Active memory usage
if 'active' in self.stats:
@ -116,7 +116,7 @@ class Plugin(GlancesPlugin):
# Total memory usage
msg = "{0:6}".format(_("total:"))
ret.append(self.curse_add_line(msg))
msg = "{0:>7}".format(self.auto_unit(format(self.stats['total']), '.1%'))
msg = "{0:>7}".format(self.auto_unit(self.stats['total']))
ret.append(self.curse_add_line(msg))
# Inactive memory usage
if 'inactive' in self.stats:

View File

@ -86,7 +86,7 @@ class Plugin(GlancesPlugin):
msg = "{0:7} ".format(_("SWAP"))
ret.append(self.curse_add_line(msg, "TITLE"))
# Percent memory usage
msg = "{0}".format(format(self.stats['percent'] / 100, '>6.1%'))
msg = "{0:>6.1%}".format(self.stats['percent'] / 100)
ret.append(self.curse_add_line(msg))
# New line
ret.append(self.curse_new_line())