mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
catch and show an exception
This commit is contained in:
@ -223,7 +223,12 @@ class CalculatorImpl(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
baseValue = parts.first().toDouble()
|
try {
|
||||||
|
baseValue = parts.first().toDouble()
|
||||||
|
} catch (e: NumberFormatException) {
|
||||||
|
context.showErrorToast(e)
|
||||||
|
}
|
||||||
|
|
||||||
if (inputDisplayedFormula.startsWith("-")) {
|
if (inputDisplayedFormula.startsWith("-")) {
|
||||||
baseValue *= -1
|
baseValue *= -1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user