fix: Handle fiat amount edgecase that makes crypto amount decimal length greater than multiplier length (#3135)

* fix: Handle fiat amount edgecase that makes crypto amount decimal length greater than multiplier length

* fix: Switch currency decimal for crypto conversion
This commit is contained in:
David Adegoke
2026-03-27 00:35:06 +01:00
committed by GitHub
parent 6378e929b6
commit ebfc339117
2 changed files with 2 additions and 3 deletions
@@ -763,7 +763,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
if (price == null || price == 0.0) return;
final crypto = _enteredAmount / price;
final depositAmountTmp = crypto.toString().withMaxDecimals(receiveCurrency.decimals);
final depositAmountTmp = crypto.toString().withMaxDecimals(depositCurrency.decimals);
if (_depositAmount != depositAmountTmp) {
changeDepositAmount(amount: depositAmountTmp, isCanonical: true);
}