mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
CWA-199 | moved limitsFormat() to xmrto_exchange_provider
This commit is contained in:
parent
99c732aab0
commit
877522d12e
2 changed files with 4 additions and 10 deletions
|
@ -1,7 +0,0 @@
|
|||
import 'package:intl/intl.dart';
|
||||
|
||||
final amountFormat = NumberFormat()
|
||||
..maximumFractionDigits = 3
|
||||
..minimumFractionDigits = 1;
|
||||
|
||||
double limitsFormat(double limit) => double.parse(amountFormat.format(limit));
|
|
@ -12,7 +12,6 @@ import 'package:cake_wallet/src/domain/exchange/xmrto/xmrto_trade_request.dart';
|
|||
import 'package:cake_wallet/src/domain/exchange/trade_not_created_exeption.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/trade_not_found_exeption.dart';
|
||||
import 'package:cake_wallet/src/domain/exchange/limits_format.dart';
|
||||
|
||||
class XMRTOExchangeProvider extends ExchangeProvider {
|
||||
XMRTOExchangeProvider()
|
||||
|
@ -69,9 +68,9 @@ class XMRTOExchangeProvider extends ExchangeProvider {
|
|||
if (price > 0) {
|
||||
try {
|
||||
min = min/price + correction;
|
||||
min = limitsFormat(min);
|
||||
min = _limitsFormat(min);
|
||||
max = max/price - correction;
|
||||
max = limitsFormat(max);
|
||||
max = _limitsFormat(max);
|
||||
} catch (e) {
|
||||
min = 0;
|
||||
max = 0;
|
||||
|
@ -194,4 +193,6 @@ class XMRTOExchangeProvider extends ExchangeProvider {
|
|||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
double _limitsFormat(double limit) => double.parse(limit.toStringAsFixed(3));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue