Hi, I've been using your Natural Sort to replace the sorting algorithm in my fork of jQuery tablesorter
But if you check out the first column of this demo you'll see that A02 and A012 don't sort correctly
I've found that if I change line 29 & 30 to the following, it works properly:
oFxNcL = isNaN(xN[cLoc]) ? xN[cLoc] || 0 : parseFloat(xN[cLoc]) || 0;
oFyNcL = isNaN(yN[cLoc]) ? yN[cLoc] || 0 : parseFloat(yN[cLoc]) || 0;
Edit: here is a simplified version : http://jsfiddle.net/Mottie/LannP/
Thanks for catching this! I can definitely see use cases with 0 left padded numbers that start with another character. I just did a quick test with your changes against the existing the unit-tests.html and it's breaking a couple of other sorts that should work. Let me try and go off your A02 and A012 example, build a few test cases and see if I can get something to work for all the test cases. On that note - have any other ideas on what I can ensure this will sort properly so I can build some more test cases..?
DOH, I forgot to check the unit tests! I haven't run into any other cases that don't work correctly, but I'll be sure to post an issue if I do run into any.
fixes for #6 #7 #16 #18 + more tests