Actions

Module

Difference between revisions of "Temperature"

From Unofficial Stationeers Wiki

m (Clarified function name)
m
 
Line 6: Line 6:
 
   local k = tonumber(raw) or 0
 
   local k = tonumber(raw) or 0
 
   local c = k - 273.15
 
   local c = k - 273.15
   return string.format("%g K (%.2f °C)", k, c)
+
   return string.format("%g K (%.1f °C)", k, c)
 
end
 
end
 
return p
 
return p

Latest revision as of 18:43, 27 August 2025

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

local p = {}
function p.convert(frame)
  local raw = frame.args[1]
            or (frame.getParent and frame:getParent().args[1])
            or "0"
  local k = tonumber(raw) or 0
  local c = k - 273.15
  return string.format("%g K (%.1f °C)", k, c)
end
return p