Module:Sandbox/RexxS/GCI06

-- Module to demonstrate a numerical comparison for Google-Code-in-2017 -- Function temperature returns conversion and text for a given input in Celsius

p = {}

p.temperature = function(frame) cel = tonumber(frame.args.celsius) or 0 fah = (cel * 9 / 5) + 32 msg = cel .. " degrees Celsius is " .. fah .. " degrees Fahrenheit. " if cel > 9 then msg = msg .. "It is warm. " else msg = msg .. "It is cold. " end return msg end

return p