catch and show an exception

This commit is contained in:
tibbi 2023-02-10 18:38:08 +01:00
parent 9285b8b3d3
commit f91137b770
1 changed files with 6 additions and 1 deletions

View File

@ -223,7 +223,12 @@ class CalculatorImpl(
return
}
baseValue = parts.first().toDouble()
try {
baseValue = parts.first().toDouble()
} catch (e: NumberFormatException) {
context.showErrorToast(e)
}
if (inputDisplayedFormula.startsWith("-")) {
baseValue *= -1
}