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:33, 18 July 2015 (SMcCandlish moved page Module:StripNonNumerals to Module:StripToNumbers without leaving a redirect: handles "." and "-" now, not just numerals). 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 = frame.args[1]
	local onlyNumbers
	onlyNumbers = (string.gsub(theString, "[^%d%.-]", ""))
	return onlyNumbers
end

return p