mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-18 04:20:46 +01:00
catch and show an exception
This commit is contained in:
parent
9285b8b3d3
commit
f91137b770
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user