Jump to content

Module:Repeat symbols

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Erik Zachte (talk | contribs) at 20:17, 16 September 2014. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}
 
function p.repeat_arg_2_3_from_arg_1 ( frame )
    num_1 = frame.args[1] ;
    str_1 = frame.args[2] ;
    str_2 = frame.args[3] ;

	-- assert(type(num_1) == "number", "function repeat_arg_2_3_from_arg_1 expects a number for first argument") ;

    mod10 = num_1 % 10 ;
    div10 = math.floor (num_1/10) ; 

    return a .. '|' .. div10 .. '|' .. mod10 .. '<br>' .. string.rep(str_1,div10) .. ' - ' .. string.rep(str_2,mod10) ;
    
end
 
return p