Pārlūkot izejas kodu

Only calculate average when 3 people have given vote

Toni Fadjukoff 6 gadus atpakaļ
vecāks
revīzija
539f9f2092
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      bot.go

+ 1 - 1
bot.go Parādīt failu

@@ -214,7 +214,7 @@ func appendAverages(wikiText string) string {
214 214
 
215 215
 			}
216 216
 		}
217
-		if strings.Index(line, AVERAGE_MARK) != -1 {
217
+		if strings.Index(line, AVERAGE_MARK) != -1 && count > 2 {
218 218
 			expression := fmt.Sprintf("'''{{#expr:(%s)/%d round 2}}'''", strings.Join(scores, "+"), count)
219 219
 			newLine := "| " + AVERAGE_MARK + " " + expression
220 220
 			changedLines = append(changedLines, newLine)