我正试着把我的手推车的价格和表器分类。结果升序排序:
9,20€
8,00€
7,23€
6,70€
5,70€
12,00€
11,00€ 我的分析者:
ts.addParser({
id: "currency",
is: function (s) {
return /^[£$€?.]/.test(s);
}, format: function (s) {
return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g), ""));
}, type: "numeric"
});我怎样才能解决这类问题?
发布于 2016-05-23 12:29:49
解决办法:
ts.addParser({
id: "euroValue",
is: function(s) {
//u20AC = €
return /^\d+,\d+\u20AC$/.test(s);
},
format: function(s) {
//replace comma and €-Symbol
return jQuery.tablesorter.formatInt( s.replace(/[, \u20AC]/g,'') );
},
type: "numeric"
});https://stackoverflow.com/questions/37385701
复制相似问题