From 7ed397ca4de49d2daa2ee1cbd236d0ec8230c94c Mon Sep 17 00:00:00 2001 From: John Schember Date: Wed, 23 Feb 2011 06:58:36 -0500 Subject: [PATCH] Better sorting of price. --- src/calibre/gui2/store/search.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/store/search.py b/src/calibre/gui2/store/search.py index 65fde3eac9..443b2a2847 100644 --- a/src/calibre/gui2/store/search.py +++ b/src/calibre/gui2/store/search.py @@ -4,6 +4,7 @@ __license__ = 'GPL 3' __copyright__ = '2011, John Schember ' __docformat__ = 'restructuredtext en' +import re from threading import Event, Thread from Queue import Queue @@ -202,6 +203,9 @@ class Matches(QAbstractItemModel): text = result.author elif col == 3: text = result.price + if len(text) < 3 or text[-3] not in ('.', ','): + text += '00' + text = re.sub(r'\D', '', text) elif col == 4: text = result.store return text