mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +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();
|
await _calculateBestRate();
|
||||||
}
|
}
|
||||||
|
_cryptoNumberFormat.maximumFractionDigits = depositMaxDigits;
|
||||||
|
|
||||||
depositAmount = _cryptoNumberFormat
|
depositAmount = _cryptoNumberFormat
|
||||||
.format(_enteredAmount / _bestRate)
|
.format(_enteredAmount / _bestRate)
|
||||||
|
@ -312,6 +313,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 +711,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