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