Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
make Lua more idiomatic
check for empty string directly
Line 53:
end
-- end hack
n = mw.ustring.len(n) == 0'' and 0 or n
e = mw.ustring.len(e) == 0'' and 0 or e
pr = math.pow(10.0,(5.0-pr))
local T1 = mw.ustring.byte(mw.ustring.sub(lett,1,1))-65
Line 312:
 
local function empty(s)
return s == nil or mw.ustring.len(s) == 0''
end