mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-17 03:50:39 +01:00
consideration of remarks : using constants and remove empty line
Co-authored-by: theom <theo.montaigu@gmail.com>
This commit is contained in:
parent
f9e4629938
commit
95b7c6b995
@ -243,8 +243,6 @@ class CalculatorImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
secondValue = parts.getOrNull(1)?.toDouble() ?: secondValue
|
secondValue = parts.getOrNull(1)?.toDouble() ?: secondValue
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastOperation != "") {
|
if (lastOperation != "") {
|
||||||
@ -437,15 +435,14 @@ class CalculatorImpl(
|
|||||||
|
|
||||||
|
|
||||||
fun getCalculatorStateJson(): JSONObject {
|
fun getCalculatorStateJson(): JSONObject {
|
||||||
|
|
||||||
val jsonObj = JSONObject()
|
val jsonObj = JSONObject()
|
||||||
jsonObj.put("res", currentResult)
|
jsonObj.put(RES, currentResult)
|
||||||
jsonObj.put("previousCalculation", previousCalculation)
|
jsonObj.put(PREVIOUS_CALCULATION, previousCalculation)
|
||||||
jsonObj.put("lastKey", lastKey)
|
jsonObj.put(LAST_KEY, lastKey)
|
||||||
jsonObj.put("lastOperation", lastOperation)
|
jsonObj.put(LAST_OPERATION, lastOperation)
|
||||||
jsonObj.put("baseValue", baseValue)
|
jsonObj.put(BASE_VALUE, baseValue)
|
||||||
jsonObj.put("secondValue", secondValue)
|
jsonObj.put(SECOND_VALUE, secondValue)
|
||||||
jsonObj.put("inputDisplayedFormula", inputDisplayedFormula)
|
jsonObj.put(INPUT_DISPLAYED_FORMULA, inputDisplayedFormula)
|
||||||
return jsonObj
|
return jsonObj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,3 +30,11 @@ const val COMMA = ","
|
|||||||
|
|
||||||
// shared prefs
|
// shared prefs
|
||||||
const val USE_COMMA_AS_DECIMAL_MARK = "use_comma_as_decimal_mark"
|
const val USE_COMMA_AS_DECIMAL_MARK = "use_comma_as_decimal_mark"
|
||||||
|
|
||||||
|
const val RES = "res"
|
||||||
|
const val PREVIOUS_CALCULATION = "previousCalculation"
|
||||||
|
const val LAST_KEY = "lastKey"
|
||||||
|
const val LAST_OPERATION = "lastOperation"
|
||||||
|
const val BASE_VALUE = "baseValue"
|
||||||
|
const val SECOND_VALUE = "secondValue"
|
||||||
|
const val INPUT_DISPLAYED_FORMULA = "inputDisplayedFormula"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user