Modulo:Demografia: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
fix dichiarazione variabile come locale |
fix lettura parametri |
||
Riga 11:
-- Converte una stringa di valori numerici separati da "," in una lista
-- Eventuali valori non numerici sono ignorati
local function read_array(args)
local years = {}
Riga 30:
local index = tonumber(i)
local year = tonumber(args['a' .. index])
if year then
years[#years+1] =
populations[#populations+1] = tonumber(args['p' .. index]) or 0
end
end
Riga 80:
for i=1,#years do
p_formatted = lang:formatNum(math.floor(tonumber(populations[i]) + 0,5) )
dump(graph, string.format(' bar: %d at: %d fontsize:S text: %s shift:(-10,5)|n.d. shift:(-8,5)\n',
year[i], populations[i], p_formatted))
end
|