Module:Test: Difference between revisions

From Elwiki
No edit summary
No edit summary
Line 3: Line 3:
function p.main(frame)
function p.main(frame)
     local passive1 = '1.2, 1.1'
     local passive1 = '1.2, 1.1'
     if string.match(passive, "%d%.%d,%s%d%.%d") then
     if string.match(passive1, "%d%.%d,%s%d%.%d") then
         return 'first index: ' .. split(passive1)[1] .. 'second index: ' .. split(passive1)[2]
         return 'first index: ' .. split(passive1)[1] .. 'second index: ' .. split(passive1)[2]
     else
     else

Revision as of 14:07, 3 April 2022

Documentation for this module may be created at Module:Test/doc

require('Module:CommonFunctions')
local p = {}
function p.main(frame)
    local passive1 = '1.2, 1.1'
    if string.match(passive1, "%d%.%d,%s%d%.%d") then
        return 'first index: ' .. split(passive1)[1] .. 'second index: ' .. split(passive1)[2]
    else
        return frame:preprocess('{{:' .. passive1 .. '}}{{#arrayprint:' .. passive1 .. '}}')
    end
    return passive
end
return p