mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When the size of a book is less that 0.1MB display the size as <0.1 instead of 0.0. Fixes #755768 (RFE: change units in size column)
This commit is contained in:
parent
9fc2c6919a
commit
e9fc4d4caa
@ -604,7 +604,10 @@ class BooksModel(QAbstractTableModel): # {{{
|
|||||||
def size(r, idx=-1):
|
def size(r, idx=-1):
|
||||||
size = self.db.data[r][idx]
|
size = self.db.data[r][idx]
|
||||||
if size:
|
if size:
|
||||||
return QVariant('%.1f'%(float(size)/(1024*1024)))
|
ans = '%.1f'%(float(size)/(1024*1024))
|
||||||
|
if ans == '0.0':
|
||||||
|
ans = '<0.1'
|
||||||
|
return QVariant(ans)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def rating_type(r, idx=-1):
|
def rating_type(r, idx=-1):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user