Content deleted Content added
update from sandbox per Template talk:Convert#Module version 30 |
move arg extraction to its own function to allow _convert() to be called from other lua modules |
||
Line 3,712:
end
local function
-- Do convert, and if needed, do it again with higher default precision.
local parms = { frame = frame or mw.getCurrentFrame() } -- will hold template arguments, after translation
set_config(
local success, result = get_parms(parms,
if success then
if type(result) ~= 'table' then
Line 3,751:
end
return success and result or message(parms, result)
end
local function main_convert(frame)
return _main_convert(frame.args, frame:getParent().args, frame)
end
Line 3,835 ⟶ 3,839:
end
return { convert = main_convert, _convert = _main_convert, _unit = _unit }
|