Natural Sort - Problem with decimal points in mixed strings

Natural Sort - Problem with decimal points in mixed strings

ArvidArvid Posts: 2Questions: 1Answers: 0

Hello,

we get a '1' (first is higher than the second) as return value, if we sort this two strings:
naturalSort("0.25 Ah", "0.7 Ah")!
But without " Ah" it is correct!

Greetings
Arvid

Answers

  • ArvidArvid Posts: 2Questions: 1Answers: 0

    The natural sort script split it wrong at line "xN = x.replace(re ..." and the next one!
    The split arrays are ["0", ".", "25", " Ah"] and ["0", ".", "7", " Ah"]!
    But it must be ["0.25", " Ah"] and ["0.7", " Ah"]!

This discussion has been closed.