PDA

View Full Version : Can't SORT money in French....Please Advise....


BrightNail
09-04-2004, 01:20 AM
function sortCash(a,b) {
return new Number(b.match(/[0-9\.]+$/)) - new Number(a.match(/[0-9\.]+$/));

}

This doesn't seem to work with "FRENCH" money....please advise..this sorts fine with US and Canadian monies..but not french...here is some french money display...


153,50 $US
320,00 $US
153,50 $US
100,00 $US
90,00 $US
400,00 $US

Please advise...

Willy Duitt
09-04-2004, 03:19 AM
Try: return new Number(b.replace(/\,/g,'.').match(/[0-9\.]+$/)) - new Number(a.replace(/\,/g,'.').match(/[0-9\.]+$/));

.....Willy