struggling with custom parser on table sorter, any ideas?

struggling with custom parser on table sorter, any ideas?

Hi Folks,

I'm having a few issues with my custom parser on table sorter. I want to be able to sort currency on our site but it comes in a variety of different formats. dollars, pounds and euros are all displayed in the usual format ($, £, €) however other currencies can be displayed by their 3 letter format such as (HKD, CZK, DKK etc).

I basically want to be able to sort the prices regardless of what comes before it and wondered if anyone knew what I need to add to my custom parser to acheive this:

  1. ts.addParser({
  2.         id: "newCurrency",
  3.         is: function(s) {
  4.             return /^[£$€€?.]/.test(s);
  5.         },
  6.         format: function(s) {
  7.             return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
  8.         },
  9.         type: "numeric"
  10.     });

Thanks in advance