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 @@ def tag_data(self, role):
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 @@ def __init__(self, name, id=None, count=0, state=0, avg=0, tooltip=None, icon=No
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