This commit is contained in:
Robert Malikowski
2026-07-03 14:09:52 +02:00
parent 72c2899195
commit 1f4054d632
7 changed files with 599 additions and 526 deletions
+7 -2
View File
@@ -174,10 +174,15 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
return maxAmount.toStringAsFixed(2);
}
Money amountForQuote(Quote quote) => Money.parse(double.parse(fiatAmount)/quote.rate, cryptoCurrency);
Money amountForQuote(Quote quote) =>
Money.parse(double.parse(fiatAmount) / quote.rate, cryptoCurrency);
Money fiatAmountForQuote(Quote quote) {
return Money.parse((fiatConversionStore.prices[cryptoCurrency]! * double.parse(amountForQuote(quote).toString())).toStringAsFixed(2), fiatCurrency);
return Money.parse(
(fiatConversionStore.prices[cryptoCurrency]! *
double.parse(amountForQuote(quote).toString()))
.toStringAsFixed(2),
fiatCurrency);
}
// based on usd values, should have roughly equal worth (was done with ai though so it's subject to correction)