Skip to content

Commit

Permalink
Fix hypothetical
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-bor committed Nov 1, 2017
1 parent 33bea44 commit 985120d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class HypotheticalView : CardView {
}

private fun updatePercentage() {
if (realCount == 0) {
percentage.visibility = View.INVISIBLE
return
}
percentage.visibility = View.VISIBLE

val realAvg = realGradeSum / realCount
val newAvg = (realGradeSum + hypoGradeSum) / (realCount + hypoCount)
val toDisplay = ((newAvg * 100) / realAvg) - 100
Expand Down

0 comments on commit 985120d

Please sign in to comment.