mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
Fixed saving history for multiple equals use
This commit is contained in:
@ -243,9 +243,10 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
|
|||||||
|
|
||||||
showNewResult(result.format())
|
showNewResult(result.format())
|
||||||
baseValue = result
|
baseValue = result
|
||||||
HistoryHelper(context).insertOrUpdateHistoryEntry(History(null, inputDisplayedFormula, result.format(), System.currentTimeMillis()))
|
val newFormula = expression.replace("sqrt", "√").replace("*", "×").replace("/", "÷")
|
||||||
|
HistoryHelper(context).insertOrUpdateHistoryEntry(History(null, newFormula, result.format(), System.currentTimeMillis()))
|
||||||
inputDisplayedFormula = result.format()
|
inputDisplayedFormula = result.format()
|
||||||
showNewFormula(expression.replace("sqrt", "√").replace("*", "×").replace("/", "÷"))
|
showNewFormula(newFormula)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
context.toast(R.string.unknown_error_occurred)
|
context.toast(R.string.unknown_error_occurred)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user