Module:Sandbox/BrandonXLF/1

This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 16:44, 9 September 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Keep Here
local p = {}
local args = {}
function p.main()
	local houoff;
	local minoff;
	local sign2;
	local args1;
	local arg1;
	
	args[1] = "6.5"
	if mw.ustring.match (args[1], '[%+%-±−]?%d%.%d+') == args[1] then		    -- eg: +5.5
		houoff = mw.ustring.match (args[1], '%d')
		args1 = mw.ustring.match (args[1], '%d.%d+')
		minoff = args1*100
		sign2 = mw.ustring.match (args[1],'[%+%-±−]?')
		minoff =  minoff-(houoff*100)
		minoff = minoff*0.6
		args[1] = table.concat ({houoff,':',minoff})
	end
	return table.concat ({args[1],' ',args1*100})
end
return p