Module:Sandbox/RexxS/GCI06

From English Wikipedia @ Freddythechick
-- 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.<br>"
	if cel > 9 then
		msg = msg .. "It is warm.<br>"
	else
		msg = msg .. "It is cold.<br>"
	end
	return msg
end

return p