mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: improve price compare.
This commit is contained in:
parent
1cf191137d
commit
00efad21a3
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user