Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
animals [2020/03/25 00:05] saph |
animals [2020/03/29 23:21] saph updated sorting function |
||
---|---|---|---|
Line 260: | Line 260: | ||
if (dir == " | if (dir == " | ||
- | if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) { | + | if ((!isNaN(x.innerHTML) && parseFloat(x.innerHTML) > parseFloat(y.innerHTML)) || |
+ | (isNaN(x.innerHTML) && | ||
shouldSwitch = true; | shouldSwitch = true; | ||
break; | break; | ||
} | } | ||
} else if (dir == " | } else if (dir == " | ||
- | if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) { | + | if ((!isNaN(x.innerHTML) && parseFloat(x.innerHTML) < parseFloat(y.innerHTML)) || |
+ | (isNaN(x.innerHTML) && | ||
shouldSwitch = true; | shouldSwitch = true; | ||
break; | break; |