File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
app/src/main/kotlin/org/fossify/math/views Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ class ConverterView @JvmOverloads constructor(
141141
142142 fun clear () {
143143 binding.topUnitText.text = " 0"
144- binding.bottomUnitText.text = " 0 "
144+ updateBottomValue()
145145 }
146146
147147 fun deleteCharacter () {
@@ -381,11 +381,17 @@ class ConverterView @JvmOverloads constructor(
381381
382382 return when (topUnit?.key) {
383383 TemperatureConverter .Unit .Celsius .key -> {
384- if (numericValue < BigDecimal (" -273.15" )) " -273.15" else value
384+ val minCelsius = BigDecimal (" -273.15" )
385+ if (numericValue < minCelsius) formatter.bigDecimalToString(minCelsius) else value
385386 }
386387
387388 TemperatureConverter .Unit .Fahrenheit .key -> {
388- if (numericValue < BigDecimal (" -459.67" )) " -459.67" else value
389+ val minFahrenheit = BigDecimal (" -459.67" )
390+ if (numericValue < minFahrenheit) {
391+ formatter.bigDecimalToString(minFahrenheit)
392+ } else {
393+ value
394+ }
389395 }
390396
391397 TemperatureConverter .Unit .Kelvin .key,
You can’t perform that action at this time.
0 commit comments