Module:Temperature: Difference between revisions
From Stationeers Wiki
More actions
Created a temperature module for easy conversions |
mNo edit summary |
||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.main(frame) | function p.main(frame) | ||
local k = tonumber(frame.args[1] | local k = tonumber(frame.args[1]) or 0 | ||
local c = k - 273.15 | local c = k - 273.15 | ||
return string.format("%g K (%.0f °C)", k, c) | return string.format("%g K (%.0f °C)", k, c) | ||
end | end | ||
return p | return p | ||
Revision as of 22:44, 27 August 2025
local p = {} function p.main(frame)
local k = tonumber(frame.args[1]) or 0
local c = k - 273.15
return string.format("%g K (%.0f °C)", k, c)
end return p