Jump to content

Module:Sandbox/Dat Hack3r: Difference between revisions

Dat Hack3r (talk | contribs)
Changed global variables to local variables.
Dat Hack3r (talk | contribs)
Fixed "string expected, got table" when using a title object.
Line 8: Line 8:
text_format = text_format or '%d'
text_format = text_format or '%d'
if title_format then
if title_format then
local curr_num = string.match(title, string.gsub(title_format, "%%d", "(%%d+)"))
local curr_num = string.match(title.text, string.gsub(title_format, "%%d", "(%%d+)"))
else
else
local curr_num = string.match(title, '%d+')
local curr_num = string.match(title.text, '%d+')
end
end