Process list: TIME+: display minutes in two digits (hh:mm:ss format only)

Display a leading zero if the number is only one digit long (00-59).
Display minutes in one digit otherwise (mm:ss.ms format, 0-59).
This commit is contained in:
Alessio Sergi 2015-04-25 14:25:17 +02:00
parent a88fb52b8d
commit afa43acdd7

View File

@ -249,7 +249,7 @@ class Plugin(GlancesPlugin):
if hours:
msg = '{0:>4}h'.format(hours)
ret.append(self.curse_add_line(msg, decoration='CPU_TIME', optional=True))
msg = '{0}:{1}'.format(minutes, seconds)
msg = '{0}:{1}'.format(str(minutes).zfill(2), seconds)
else:
msg = '{0:>4}:{1}.{2}'.format(minutes, seconds, microseconds)
else: