Content deleted Content added
sync sandbox |
use unicode functions |
||
Line 39:
local function northeast(lett,num,shift)
-- split into northings and eastings
local le=
if le%2 == 1 then
return "Malformed numerical part of NGR"
end
local pr=le/2
local n =
local e =
-- Hack to move to center of square: append a 5 to northings and eastings
if shift ~= nil and shift > 0 then
Line 53:
end
-- end hack
if
n = 0
end
if
e = 0
end
pr = math.pow(10.0,(5.0-pr))
local T1 =
if T1>8 then
T1 = T1-1
end
local T2 = nil
if
T2 =
if T2>8 then
T2 = T2-1
Line 272:
local function NGR2LL(ngr)
-- returns a country,error,lat,long list
ngr =
local lett =
local num =
if
return Irish2LL(lett,num)
end
if
return GB2LL(lett,num)
end
Line 290:
end
local t = {}
for chunk in
table.insert(t,chunk)
end
Line 297:
local function trim(s)
s =
s =
return s
end
local function alldigits(s)
return
end
Line 320:
local args = getArgs(frame,{parentFirst=true,parentOnly=false,frameOnly=false})
local input = args[1]
if input == nil or
return warning(nil)
end
Line 332:
local pagename = mw.uri.encode( current_page.prefixedText, 'WIKI' );
if #args >= 2 and alldigits(args[2]) then
if
local firstArg =
if alldigits(firstArg) then
LL = {IrishEN2LL(firstArg,args[2])}
restargs = 3
if linktitle == nil or
linktitle=args[1]..'_'..args[2]
end
Line 344:
LL = {GBEN2LL(args[1],args[2])}
restargs = 3
if linktitle == nil or
linktitle=args[1]..'_'..args[2]
end
Line 351:
LL = {NGR2LL(args[1])}
restargs = 2
if linktitle == nil or
linktitle=args[1]
end
Line 377:
url = url..'_'..args[i]
end
if
url = url..'_region:'..LL[1]
end
|