Jump to content

Module:User:Mr rnddude/Sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Up to 2500 feet.
Module for testing
Line 1: Line 1:
-- This is my module sandbox.
-- This is my module sandbox.
-- Simple repetition module.
-- Simple pre-module for a
-- requested template.
-- At Sea level on an ISA day,
-- the pressure should be 1013.2 hPa.
-- I've reduced this to 1013 hPa. Up to
-- 5,000 feet the pressure reduces by 1
-- hPa per 27 feet. Beyond 5,000 feet
-- the rate of reduction decreases. Off
-- the top of my head I can't remember
-- what it is (1/30ft?), but, whatever.


P = 1014 -- hPa
P = 1014 -- hPa
Line 16: Line 9:
local p = {}
local p = {}


function p.Altitude (frame)
function p.Percentage (frame)
-- Percentage = share/total * 100
output = "Altitude (Feet), Pressure (hPa)"
return s/t * 100
repeat
MSL = MSL + Incr
P = P - 1
output = output .. "<br />" .. MSL .. ", " .. P
until (MSL > 2500 or P < 0)
return output
end
end

return p

Revision as of 14:01, 6 March 2018

-- This is my module sandbox.
-- Simple pre-module for a
-- requested template.

P = 1014 -- hPa
Incr = 27 -- feet
MSL = -27 -- feet

local p = {}

function p.Percentage (frame)
	-- Percentage = share/total * 100
	return s/t * 100
end