mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the average stay a floating point number
This commit is contained in:
parent
79202dc833
commit
368eced255
@ -301,7 +301,7 @@ class TagTreeItem(object): # {{{
|
|||||||
if self.tag.avg is None:
|
if self.tag.avg is None:
|
||||||
return QVariant('[%d] %s'%(self.tag.count, self.tag.name))
|
return QVariant('[%d] %s'%(self.tag.count, self.tag.name))
|
||||||
else:
|
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:
|
if role == Qt.EditRole:
|
||||||
return QVariant(self.tag.name)
|
return QVariant(self.tag.name)
|
||||||
if role == Qt.DecorationRole:
|
if role == Qt.DecorationRole:
|
||||||
|
@ -61,7 +61,7 @@ class Tag(object):
|
|||||||
self.id = id
|
self.id = id
|
||||||
self.count = count
|
self.count = count
|
||||||
self.state = state
|
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.tooltip = tooltip
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user