Permanently protected module
From Wikipedia, the free encyclopedia


local p = {}

function p.main(frame)

	local theString = mw.text.unstrip(frame.args1])

	local onlyNumber

	onlyNumber = (string.match(theString, "%-?[%d%.]+"))

	checkedNumber = tonumber(onlyNumber)

	if checkedNumber == nil then

		error(" Input did not contain valid numeric data")

	else

		return checkedNumber

	end

end



function p.halve(frame)

	local checkedNumber = (p.main(frame))

	local halvedNumber

	halvedNumber = (checkedNumber / 2)

	return halvedNumber

end

function p.mainnull(frame)

	local theString = mw.text.unstrip(frame.args1])

	local onlyNumber

	onlyNumber = (string.match(theString, "%-?[%d%.]+"))

	checkedNumber = tonumber(onlyNumber)

	if checkedNumber == nil then

		return nil

	else

		return checkedNumber

	end

end

return p
Permanently protected module
From Wikipedia, the free encyclopedia


local p = {}

function p.main(frame)

	local theString = mw.text.unstrip(frame.args1])

	local onlyNumber

	onlyNumber = (string.match(theString, "%-?[%d%.]+"))

	checkedNumber = tonumber(onlyNumber)

	if checkedNumber == nil then

		error(" Input did not contain valid numeric data")

	else

		return checkedNumber

	end

end



function p.halve(frame)

	local checkedNumber = (p.main(frame))

	local halvedNumber

	halvedNumber = (checkedNumber / 2)

	return halvedNumber

end

function p.mainnull(frame)

	local theString = mw.text.unstrip(frame.args1])

	local onlyNumber

	onlyNumber = (string.match(theString, "%-?[%d%.]+"))

	checkedNumber = tonumber(onlyNumber)

	if checkedNumber == nil then

		return nil

	else

		return checkedNumber

	end

end

return p

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook