catch and show an exception
This commit is contained in:
parent
9285b8b3d3
commit
f91137b770
|
@ -223,7 +223,12 @@ class CalculatorImpl(
|
|||
return
|
||||
}
|
||||
|
||||
try {
|
||||
baseValue = parts.first().toDouble()
|
||||
} catch (e: NumberFormatException) {
|
||||
context.showErrorToast(e)
|
||||
}
|
||||
|
||||
if (inputDisplayedFormula.startsWith("-")) {
|
||||
baseValue *= -1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue