f =
-- Dan il-metodu jirritorna l-għadd ta' oġġetti bil-Malti magħdud man-nom (il-metodu ma japplikax għal oġġetti/nomi li jużaw il-plural miksur). Il-parametri huma:-- number: kwantità ta' oġġetti-- singular: il-verżjoni bis-singular tal-oġġett/nom-- plural: il-verżjoni bil-plural tal-oġġett/nom-- formatNumber: għażla jekk tridx tirranġa n-numru bil-virgoli jew mingħajrhomlocal function getNounCount(number, singular, plural, formatNumber) formattedNumber = formatNumber and mw.getContentLanguage:formatNum(number) or number flooredNearestHundred = math.floor(number / 100) * 100 difference = number - flooredNearestHundred if number
function f.kwantitaNom(frame) local number = tonumber(frame.args.number) local singular = frame.args.singular local plural = frame.args.plural local formatNumber = frame.args.formatNumber return getNounCount(number, singular, plural, formatNumber)end
function f.numruArtikli return getNounCount(mw.site.stats.articles, 'artiklu', 'artikli', true)end
return f