We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c236c7f commit 335984cCopy full SHA for 335984c
1 file changed
Table.lua
@@ -26,17 +26,14 @@ local function stripFormattingForSort(text)
26
return text
27
end
28
29
---- Comparable value from visible cell text (ratio, number, or lowercase string).
+--- Comparable value from visible cell text (progress N/M uses numerator; plain number; else lowercase string).
30
---@param text string?
31
---@return number|string
32
function Table:GetCellTextSortValue(text)
33
text = stripFormattingForSort(text)
34
local num, den = text:match("^%s*(%d+)%s*/%s*(%d+)%s*$")
35
if num and den then
36
- local d = tonumber(den)
37
- if d and d ~= 0 then
38
- return tonumber(num) / d
39
- end
+ return tonumber(num)
40
41
local numeric = tonumber(text:match("^%s*([%+%-]?[%d%.]+)%s*$"))
42
if numeric ~= nil then
0 commit comments