From 5555aa51389ff9b11d42c7b5bf33f47ce75ed6df Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Nov 2017 16:51:59 +0100 Subject: [PATCH] some bugfixes --- .../simplemobiletools/calculator/helpers/CalculatorImpl.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 8f24bbf8..1cf2715b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt @@ -82,7 +82,7 @@ class CalculatorImpl { private fun formatString(str: String): String { // if the number contains a decimal, do not try removing the leading zero anymore, nor add group separator // it would prevent writing values like 1.02 - if (str.contains("")) + if (str.contains(".")) return str val doubleValue = Formatter.stringToDouble(str) @@ -165,8 +165,8 @@ class CalculatorImpl { private fun decimalClicked() { var value = displayedNumber - if (!value!!.contains("")) - value += "" + if (!value!!.contains(".")) + value += "." setValue(value) }