词条 | 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 |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。