I'm trying to sort a list as follows:
(setq rlst (list '("1.02" "A" "B" "DEF" "id10t") '("2.06" "Q" "R" "STU" "pid") '("10.05" "L" "M" "N-O-PEE" "id10ts") '("39.22" "H" "I" "MOM" "LovE") '("122.22" "X" "Y" "ZED" "fail")))
I'm needing is sort as follows:
(("1.02" "A" "B" "DEF" "id10t")("2.06" "Q" "R" "STU" "pid")("10.05" "L" "M" "N-O-PEE" "id10ts")("39.22" "H" "I" "MOM" "LovE")("122.22" "X" "Y" "ZED" "fail"))
Using (vl-sort rlst '(lambda (x y) (< (car x) (car y))))) results in:
(("1.02" "A" "B" "DEF" "id10t")("10.05" "L" "M" "N-O-PEE" "id10ts")("122.22" "X" "Y" "ZED" "fail")("2.06" "Q" "R" "STU" "pid")("39.22" "H" "I" "MOM" "LovE"))
I understand that (< (car x) (car y)) is sorting the first item of the list. In this case the number. What I can't figure out is how to modify that to sort the whole numbers. i.e. 1, 2, 10, 39, 122. I can't put zeros in front of the whole numbers to make them all 3 or more digits. Everything after the decimal point doesn't matter, unless the whole number is the same. There will always be two hundredths after decimal point.
Any pointers of where to start? Can I substitute (< (car x) (car y)) with several lines of code to add zeros to the numbers to equal 5 digits, then do the sort and then return the numbers back to the original?
All help is greatly appreciated.
Rabbit