let's not divide by zero

pull/9791/head
Thibault Duplessis 2021-09-13 11:37:13 +02:00
parent cf9a90d4c8
commit 75436fa831
1 changed files with 1 additions and 1 deletions

View File

@ -31,5 +31,5 @@ final private class MonthlyGoalApi(getGoal: () => Usd, chargeColl: Coll)(implici
case class MonthlyGoal(current: Usd, goal: Usd) {
def percent = (100 * current.value / goal.value).toInt
def percent = (goal.value > 0) ?? (100 * current.value / goal.value).toInt
}