mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
Fix batch converter for negative values
This commit is contained in:
parent
47a8800206
commit
532931914e
@ -183,7 +183,7 @@ internal class ConverterViewModel @Inject constructor(
|
||||
unitTo = unitTo,
|
||||
sorting = prefs.unitConverterSorting,
|
||||
favorites = prefs.unitConverterFavoritesOnly,
|
||||
input = calculation?.toPlainString() ?: input.text,
|
||||
input = (calculation?.toPlainString() ?: input.text).replace(Token.Operator.minus, "-"),
|
||||
scale = prefs.precision,
|
||||
outputFormat = prefs.outputFormat,
|
||||
formatterSymbols = AllFormatterSymbols.getById(prefs.separator),
|
||||
|
@ -110,7 +110,6 @@ private fun RightSideScreen(
|
||||
}
|
||||
|
||||
items(units, { it.id }) {
|
||||
|
||||
BasicUnitListItem(
|
||||
modifier = Modifier.animateItemPlacement(),
|
||||
name = stringResource(it.displayName),
|
||||
@ -154,11 +153,10 @@ private fun formatUnitToSupportLabel(
|
||||
formatterSymbols: FormatterSymbols,
|
||||
readyCurrencies: Boolean,
|
||||
): String {
|
||||
try {
|
||||
if ((unitFrom?.group == UnitGroup.CURRENCY) and !readyCurrencies) {
|
||||
return shortName
|
||||
}
|
||||
if ((unitFrom?.group == UnitGroup.CURRENCY) and !readyCurrencies) return shortName
|
||||
if (input.isEmpty()) return shortName
|
||||
|
||||
try {
|
||||
if ((unitFrom is DefaultUnit) and (unitTo is DefaultUnit)) {
|
||||
unitFrom as DefaultUnit
|
||||
unitTo as DefaultUnit
|
||||
|
Loading…
x
Reference in New Issue
Block a user