View source for Module:StripToNumbers
MyWikiBiz, Author Your Legacy — Friday May 16, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
local p = {}
function p.main(frame)
local theString = mw.text.unstrip(frame.args[1])
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.args[1])
000
1:0
Templates used on this page:
Return to Module:StripToNumbers.