Skip to content

Commit

Permalink
resolved logic error in automatic accuracy calculation
Browse files Browse the repository at this point in the history
when calculating the automatic accuracy while recording the workout the averages of past accuracies should be rounded to values dividable by 10 to adjust for tolerances. Previously it rounded to 10 decimal places, now it rounds to -1
  • Loading branch information
timfraedrich committed Aug 16, 2020
1 parent 70fe671 commit 2c385c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ extension WorkoutBuilder {

self.averageAccuracy = ( self.averageAccuracy * globalCount + averageAccuracy * localCount ) / ( globalCount + localCount )

self.desiredAccuracy = averageAccuracy < 20 ? 20 : self.averageAccuracy.rounded(decimalPlaces: 10, rule: .up)
self.desiredAccuracy = averageAccuracy < 20 ? 20 : self.averageAccuracy.rounded(decimalPlaces: -1, rule: .up)

}

Expand Down

0 comments on commit 2c385c4

Please sign in to comment.