Przeglądaj źródła

mat_competitors: show total

raylu 1 tydzień temu
rodzic
commit
312e90e0a8
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      mat_competitors.py

+ 3 - 0
mat_competitors.py

@@ -49,8 +49,11 @@ def main() -> None:
 			competitors.append(Competitor(code, co_name, username, mat_production['amount'], bases))
 	competitors.sort(reverse=True)
 
+	total = 0.0
 	for c in competitors:
 		print(f'{c.code:4} {c.company_name:30} {c.username:20} {c.production:9,.1f}', ', '.join(c.bases))
+		total += c.production
+	print(f'total: {total:,.1f}')
 
 def iter_expertise(ticker: str) -> typing.Iterator[str]:
 	buildings: typing.Sequence[company.Building] = cache.get('https://rest.fnar.net/building/allbuildings', expiry=cache.ONE_DAY)