Module:Sandbox/Alexiscoutinho: Difference between revisions

Content deleted Content added
Blanked the page
Tag: Blanking
No edit summary
Line 1:
local p = {}
 
function p.buildRows( frame )
local barwidth = frame.args.barwidth
local data = frame.args.data
local divisor = frame.args.divisor
local numwidth = frame.args.numwidth
local collapsible = frame.args.collapsible
 
local lines = mw.text.split( data, '\n' )
 
if not divisor then
local i = 1
local total1, total2 = 0, 0
 
for parameter in mw.text.gsplit( lines[#lines], ';' ) do
if string.find( parameter, '^ *%A' ) then
if i == 6 then
total1 = tonumber( string.gsub( parameter, '%D', '' ) )
if not total1 then
total1 = 0
end
elseif i == 8 then
total2 = tonumber( string.gsub( parameter, '%D', '' ) )
if not total2 then
total2 = 0
end
break
end
i = i + 1
end
end
divisor = math.max( total1, total2 ) / ( 0.95 * barwidth )
end
return divisor
end
return p