Surface the % of players represented in metrics

This commit is contained in:
Gabe Kangas
2022-03-27 16:27:38 -07:00
parent 9f6151359f
commit 1e19e2a50e
5 changed files with 26 additions and 1 deletions

View File

@ -387,3 +387,8 @@ func ShuffleStringSlice(s []string) []string {
})
return s
}
// IntPercentage returns an int percentage of a number.
func IntPercentage(x, total int) int {
return int(float64(x) / float64(total) * 100)
}