Jump to content

Module:Strip to numbers

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SMcCandlish (talk | contribs) at 07:26, 18 July 2015 (derp). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
function p.main(frame)
        local theString
	local theString = frame.args[1]
        local theStringEscaped
        theStringEscaped = (mw.text.nowiki(theString))
	local onlyNumbers
	onlyNumbers = (string.gsub(theStringEscaped, "[^%d%.-]", ""))
	return onlyNumbers
end

return p