mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
truncate exchange amount
This commit is contained in:
parent
8b7bfd74e3
commit
3e43e899a5
1 changed files with 6 additions and 0 deletions
|
@ -287,6 +287,7 @@ abstract class ExchangeViewModelBase with Store {
|
|||
|
||||
await _calculateBestRate();
|
||||
}
|
||||
_cryptoNumberFormat.maximumFractionDigits = depositMaxDigits;
|
||||
|
||||
depositAmount = _cryptoNumberFormat
|
||||
.format(_enteredAmount / _bestRate)
|
||||
|
@ -312,6 +313,7 @@ abstract class ExchangeViewModelBase with Store {
|
|||
|
||||
await _calculateBestRate();
|
||||
}
|
||||
_cryptoNumberFormat.maximumFractionDigits = receiveMaxDigits;
|
||||
|
||||
receiveAmount = _cryptoNumberFormat
|
||||
.format(_bestRate * _enteredAmount)
|
||||
|
@ -709,4 +711,8 @@ abstract class ExchangeViewModelBase with Store {
|
|||
providerList = _allProviders;
|
||||
}
|
||||
}
|
||||
|
||||
int get depositMaxDigits => depositCurrency == CryptoCurrency.btc ? 8 : 12;
|
||||
|
||||
int get receiveMaxDigits => receiveCurrency == CryptoCurrency.btc ? 8 : 12;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue