win rate, 2020 bug

This commit is contained in:
Michael Simard
2021-01-22 11:58:18 -06:00
parent 3ae103acbb
commit 69829a9f01
2 changed files with 19 additions and 1 deletions

View File

@@ -127,6 +127,10 @@ final class StatsWithMostRecentDailyRecord: Content {
var totalLosses:Int
var mostRecentRecord:String
var winRate:String {
return "\((Double((Double(totalWins)/Double(totalWins + totalLosses))) * 100.0).truncate(places: 1))%"
}
init( winLoss:String, totalWins:Int, totalLosses:Int, mostRecentRecord:String ) {
self.winLossRatio = winLoss
self.totalWins = totalWins