Jump to content

Module:Gaps

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by The Mol Man (talk | contribs) at 18:18, 2 July 2014. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

function p._make(frame)
	local parameters = frame:getParent().args
	local size = parameters['size'] or ''
	
	local ret_string = '<span style="white-space: nowrap;'..size..'">'
	
	if parameters['lhs'] then
		ret_string = ret_string..parameters['lhs']..' = '
	end
	
	for i=1,20,1 do
		ret_string = ret_string..'<span style="margin-left: 0.2em">'..parameters[i]..'</span>'
		if not parameters[i] then
			break
		end
	end
	
	if parameters['e'] then
		local base = parameters['base'] or '10'
		ret_string = ret_string..'<span style="margin-left: 0.27em; margin-right: 0.27em">×</span>'..
					base ..'<span style="display:none">^</span><sup>'..parameters['e']..'</sup>'
	end
	
	if parameters['u'] then
		ret_string = ret_string..'&nbsp;'..parameters['u']
	end
	
	return ret_string
end

return p