|
|
|
|
|
by freeopinion
269 days ago
|
|
It is neither simple, nor reasonable. 1.10, the number, is equivalent to 1.1. It is less than 1.2. You say you want numbers to sort as numbers, but you want 1.10 to be greater than 1.2. Do you consider '1/4' to be a number? Should it come before or after '1/3'? I'm guessing that you don't want to sort one character at a time if you encounter one of [0-9]. Instead, you want to group all consecutive [0-9] as a single sortable number. But aren't characters '.', ',', '/', '-' also part of numbers? What about numbers like ↋, 五, π, B, ⅔, or -1? |
|
Treating consecutive digits as numbers is a simple modification (I still think it’s quite simple) that is easy to understand and supports 99% of real-world use cases.