Skip to content

Commit 335984c

Browse files
committed
Sort by N in 'N / M' instead of N / M ratio (%) on columns with no sort callback
1 parent c236c7f commit 335984c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Table.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ local function stripFormattingForSort(text)
2626
return text
2727
end
2828

29-
--- Comparable value from visible cell text (ratio, number, or lowercase string).
29+
--- Comparable value from visible cell text (progress N/M uses numerator; plain number; else lowercase string).
3030
---@param text string?
3131
---@return number|string
3232
function Table:GetCellTextSortValue(text)
3333
text = stripFormattingForSort(text)
3434
local num, den = text:match("^%s*(%d+)%s*/%s*(%d+)%s*$")
3535
if num and den then
36-
local d = tonumber(den)
37-
if d and d ~= 0 then
38-
return tonumber(num) / d
39-
end
36+
return tonumber(num)
4037
end
4138
local numeric = tonumber(text:match("^%s*([%+%-]?[%d%.]+)%s*$"))
4239
if numeric ~= nil then

0 commit comments

Comments
 (0)