Modul:Goalscorers: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
kTidak ada ringkasan suntingan
hapus penggunaan parameter plural di teks, rata-rata gol formatNum:id
Baris 93:
local Date = require('Module:Date')._Date
local pluralGoals = "s"
local text1 = ""
if g.totalGoals == 1 then
Baris 101:
if dateUpdated == 'complete' then text1 = " " else text1 = " " end
end
local text = string.format("Sebanyak %s %s gol%s telah dicetak", text1, mw.getLanguage('enid'):formatNum(g.totalGoals), pluralGoals)
local pluralMatches = "."
if matches==1 then pluralMatches = "" end
if matches then
local average = g.totalGoals/tonumber(matches)
local precision = 3 -- displaytampilan d.dd (threetiga significantdigit disgitsangka)
if average < 1 then precision = 2 end -- displaytampilan 0.dd (thwodua significantdigit disgitsangka)
average = tostring (average)
 
local pluralAverage = ""
if tonumber(string.format("%.2f",average))==1 then pluralAverage = "" end
text = text .. string.format(" pada %d pertandingan%s, dengan rata-rata %."..precision.."g gol%s per pertandingan", matches, pluralMatches, mw.getLanguage('id'):formatNum(average, pluralAverage))
end