3,822
edits
MusikAnimal (talk | contribs) (yet more fixes to sorting) |
MusikAnimal (talk | contribs) (try again........ I think this might actually work) |
||
Line 650: | Line 650: | ||
if int1 == int2 then | if int1 == int2 then | ||
return true | return true | ||
end | |||
elseif tonumber(num1) == nil and tonumber(num2) ~= nil then | |||
-- first is string, second is number | |||
if int1 == int2 then | |||
return false | |||
end | end | ||
elseif tonumber(num1) == nil and tonumber(num2) == nil then | elseif tonumber(num1) == nil and tonumber(num2) == nil then | ||
-- both are strings, | -- both are strings, should be compared as strings if they are the same number | ||
return num1 < num2 | if int1 == int2 then | ||
return num1 < num2 | |||
end | |||
end | end | ||
return tonumber(int1) < tonumber(int2) | return tonumber(int1) < tonumber(int2) |