mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
truncate exchange amount
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user