Modul:Goalscorers: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
tabel untuk pencetak gol yang hanya mencetak 1 gol |
perbaikan averageString dan updateString untuk bagian templat |
||
(7 revisi perantara oleh 2 pengguna tidak ditampilkan) | |||
Baris 90:
function p.addIntroductorySentence() -- menambahkan teks/paragraf awal
local totalGoalString = "Sebanyak" .. g.totalGoals .. "
local matches, dateUpdated = p.getNumberMatches()
Baris 97:
local Date = require('Module:Date')._Date
local text1 = ""
local text = string.format("Sebanyak %s gol telah dicetak", mw.getLanguage('id'):formatNum(g.totalGoals))▼
if g.totalGoals >= 1 then
if dateUpdated ~= 'complete' or dateUpdated ~= 'completed' or dateUpdated ~= 'selesai' then text1 = "telah dicetak" end
else
if dateUpdated == 'complete' or dateUpdated == 'completed' or dateUpdated == 'selesai' then text1 = "dicetak" end
end
▲ local text = string.format("Sebanyak %s gol
if matches then
Baris 103 ⟶ 110:
local precision = 3 -- presisi dua angka dibelakang koma
if average < 1 then precision = 2 end -- presisi satu angka dibelakang koma
average = string.format("%."..precision.."g", average)
end
if dateUpdated == 'complete' or dateUpdated =='completed' or dateUpdated =='selesai' or dateUpdated == "" then
text = text .. "."
else
Baris 898 ⟶ 904:
{{#if:{{{extra|}}}|{{{extra}}}{{clear}}|}}
--]]
local statNumber =
local matches = g.args['matches']
local statType = "gol"
if g.args['assists'] or g.args['umpan gol'] then statType = "umpan gol" end
if g.args['clean sheets'] or g.args['nirbobol'] then statType = "nirbobol" end
local ongoing = g.args['ongoing']
local text1 = "Sebanyak"
if g.args['lc'] then text1 = "
local text2 = ""
if ongoing then text2 = "telah" end
local updateString = ""
local averageString = ""
-- auto version: string.format(" pada %d pertandingan, dengan rata-rata %.3g gol per pertandingan")
if g.args['goals'] and g.args['matches'] then
local averageGoals = g.args['goals']/g.args['matches']
averageString = string.format("
end
if g.args['updated'] and g.args['updated'] ~= "complete" and g.args['updated'] ~= "completed" and g.args['updated'] ~= "selesai" then
updateString = " (per " ..g.args['updated'].. ")"
end
local
if g.args['sep'] then sep = g.args['sep'] end
local text = ""
if g.args['goals'] then --Sebanyak %statNumber %statType telah dicetak pada %matches pertandingan, dengan rata-rata %averageString per pertandingan (%updateString)
text = string.format("%s %
text1, text2, statNumber, statType,
end
text = p.addAdditionHeaderText(text) -- handles template parameters bold, further, extra
|