FANDOM


local p = {}
 
function p._starnumber(num, maxnum) -- num of stats / maximal number of stars possible (shows grey stars for the difference)
	if not num then
		return nil
	end
	if not tonumber(num) then
		return num .. '(?)' -- error handling ?
	end
	num = tonumber(num)
	local maxnum = tonumber(maxnum) or num
	local starsize = '11px'
	if maxnum > 6 then
		starsize = '7px'
	end
 
	local str = ''
	local images = {
		full = 'Star full.svg',
		half = 'Star half.svg',
		empty = 'Star empty.svg'
	}
	local function addstar(startype)
		str = str .. '[[File:' .. images[startype] .. '|' .. starsize .. ']]'
	end
 
	for i = 1, math.floor(num) do
		addstar('full')
	end
 
	if num > math.floor(num) then -- demi étoiles
		addstar('half')
	end
 
	for i = 1, (maxnum - math.ceil(num)) do
		addstar('empty')
	end
 
	return  '<span style="white-space:nowrap">' .. str  .. '</span>'
end
 
function p.starnumber(frame)
	return p._starnumber(frame.args[1], frame.args[2])
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.