Store: improve price compare.

This commit is contained in:
John Schember 2011-07-04 15:07:49 -04:00
parent 1cf191137d
commit 00efad21a3

View File

@ -22,6 +22,7 @@ from calibre.utils.icu import sort_key
from calibre.utils.search_query_parser import SearchQueryParser from calibre.utils.search_query_parser import SearchQueryParser
def comparable_price(text): def comparable_price(text):
text = re.sub(r'[^0-9.,]', '', text)
if len(text) < 3 or text[-3] not in ('.', ','): if len(text) < 3 or text[-3] not in ('.', ','):
text += '00' text += '00'
text = re.sub(r'\D', '', text) text = re.sub(r'\D', '', text)