Module:Infobox Species: Difference between revisions

From Errapedia
Jump to navigation Jump to search
(Created page with "local p = {} function p.ValidateNumber( frame ) if tonumber(frame.args[1]) ~= nil then return "yes" end return "no" end")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}
local h = {}


function p.ValidateNumber( frame )
function p.ValidateNumber( frame )
Line 7: Line 8:
     return "no"
     return "no"
end
end
function p.ConvertHeightToCentimeters( frame )
    if tonumber(frame.args[1]) ~= nil then
        local height = tonumber(frame.args[1])
        height = height * 100
        return tostring(height)
    end
    return ""
end
function p.ErrorCheck( frame )
    mw.addWarning("test")
end
return p

Latest revision as of 20:44, 9 February 2023

Documentation for this module may be created at Module:Infobox Species/doc

local p = {}
local h = {}

function p.ValidateNumber( frame )
    if tonumber(frame.args[1]) ~= nil then
        return "yes"
    end
    return "no"
end

function p.ConvertHeightToCentimeters( frame )
    if tonumber(frame.args[1]) ~= nil then
        local height = tonumber(frame.args[1])
        height = height * 100
        return tostring(height)
    end
    return ""

end

function p.ErrorCheck( frame )
    mw.addWarning("test")
end

return p