Module:Coordinates: Difference between revisions

coord2text: Allow lat/long to start with a decimal or a number
m (dummy edit to force a refresh)
(coord2text: Allow lat/long to start with a decimal or a number)
Line 680:
frame.args[2] = mw.text.trim(frame.args[2])
if frame.args[2] == 'lat' or frame.args[2] == 'long' then
local result, negative = mw.text.split((mw.ustring.match(frame.args[1],'[%d+.?%d*]+°[NS] [%d+.?%d*]+°[EW]') or ''), ' ')
if frame.args[2] == 'lat' then
result, negative = result[1], 'S'
Anonymous user