mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-23 06:38:35 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user