Module:TableTools: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
p.affixNums: move the pattern-generating code out of the loop
(use a hack to handle NaN values)
(p.affixNums: move the pattern-generating code out of the loop)
Line 135:
prefix = prefix or ''
suffix = suffix or ''
local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
local nums = {}
for k, v in pairs(t) do
if type(k) == 'string' then
local num = mw.ustring.match(k, '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'pattern)
if num then
nums[#nums + 1] = tonumber(num)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu