Make the average stay a floating point number

This commit is contained in:
Charles Haley 2010-06-11 18:38:40 +01:00
parent 79202dc833
commit 368eced255
2 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ class TagTreeItem(object): # {{{
if self.tag.avg is None:
return QVariant('[%d] %s'%(self.tag.count, self.tag.name))
else:
return QVariant('[%d][%d] %s'%(self.tag.count, self.tag.avg, self.tag.name))
return QVariant('[%d][%3.1f] %s'%(self.tag.count, self.tag.avg, self.tag.name))
if role == Qt.EditRole:
return QVariant(self.tag.name)
if role == Qt.DecorationRole:

View File

@ -61,7 +61,7 @@ class Tag(object):
self.id = id
self.count = count
self.state = state
self.avg = avg/2 if avg is not None else 0
self.avg = avg/2.0 if avg is not None else 0
self.tooltip = tooltip
self.icon = icon