From 210020895f68586c34351f0f7eec48c0d46b050b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 28 Dec 2020 19:58:55 +0100 Subject: [PATCH] add a hackfix for pressing Root as first operation --- .../simplemobiletools/calculator/helpers/CalculatorImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt index 83c302de..7933cf14 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt @@ -73,7 +73,9 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) { } if (operation == ROOT && inputDisplayedFormula == "0") { - inputDisplayedFormula = "√" + if (lastKey != DIGIT) { + inputDisplayedFormula = "1√" + } } val lastChar = inputDisplayedFormula.last().toString()