mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
Merge pull request #855 from cake-tech/CW-340-Truncate-estimated-btc-amount-in-Exchange
CW-340-Truncate-estimated-btc-amount-in-Exchange
This commit is contained in:
commit
a081f6f829
1 changed files with 6 additions and 1 deletions
|
@ -97,7 +97,6 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
receiveAddress = '';
|
receiveAddress = '';
|
||||||
depositAddress = depositCurrency == wallet.currency
|
depositAddress = depositCurrency == wallet.currency
|
||||||
? wallet.walletAddresses.address : '';
|
? wallet.walletAddresses.address : '';
|
||||||
_cryptoNumberFormat = NumberFormat()..maximumFractionDigits = wallet.type == WalletType.bitcoin ? 8 : 12;
|
|
||||||
provider = providersForCurrentPair().first;
|
provider = providersForCurrentPair().first;
|
||||||
final initialProvider = provider;
|
final initialProvider = provider;
|
||||||
provider!.checkIsAvailable().then((bool isAvailable) {
|
provider!.checkIsAvailable().then((bool isAvailable) {
|
||||||
|
@ -287,6 +286,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
|
|
||||||
await _calculateBestRate();
|
await _calculateBestRate();
|
||||||
}
|
}
|
||||||
|
_cryptoNumberFormat.maximumFractionDigits = depositMaxDigits;
|
||||||
|
|
||||||
depositAmount = _cryptoNumberFormat
|
depositAmount = _cryptoNumberFormat
|
||||||
.format(_enteredAmount / _bestRate)
|
.format(_enteredAmount / _bestRate)
|
||||||
|
@ -312,6 +312,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
|
|
||||||
await _calculateBestRate();
|
await _calculateBestRate();
|
||||||
}
|
}
|
||||||
|
_cryptoNumberFormat.maximumFractionDigits = receiveMaxDigits;
|
||||||
|
|
||||||
receiveAmount = _cryptoNumberFormat
|
receiveAmount = _cryptoNumberFormat
|
||||||
.format(_bestRate * _enteredAmount)
|
.format(_bestRate * _enteredAmount)
|
||||||
|
@ -709,4 +710,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||||
providerList = _allProviders;
|
providerList = _allProviders;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get depositMaxDigits => depositCurrency == CryptoCurrency.btc ? 8 : 12;
|
||||||
|
|
||||||
|
int get receiveMaxDigits => receiveCurrency == CryptoCurrency.btc ? 8 : 12;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue