CWA-169 | renamed checkAmount() to formatAmount()

This commit is contained in:
Oleksandr Sobol 2020-02-11 22:50:10 +02:00
parent 30a7e5c4c8
commit d88945411f
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
String checkAmount(String amount) { String formatAmount(String amount) {
if (!amount.contains('.')) { if (!amount.contains('.')) {
return amount + '.00'; return amount + '.00';
} else if (amount.endsWith('.')) { } else if (amount.endsWith('.')) {

View file

@ -2,7 +2,7 @@ import 'package:cake_wallet/src/domain/monero/monero_amount_format.dart';
import 'package:cw_monero/structs/transaction_info_row.dart'; import 'package:cw_monero/structs/transaction_info_row.dart';
import 'package:cake_wallet/src/domain/common/parseBoolFromString.dart'; import 'package:cake_wallet/src/domain/common/parseBoolFromString.dart';
import 'package:cake_wallet/src/domain/common/transaction_direction.dart'; import 'package:cake_wallet/src/domain/common/transaction_direction.dart';
import 'package:cake_wallet/src/domain/common/check_amount.dart'; import 'package:cake_wallet/src/domain/common/format_amount.dart';
class TransactionInfo { class TransactionInfo {
TransactionInfo(this.id, this.height, this.direction, this.date, TransactionInfo(this.id, this.height, this.direction, this.date,
@ -41,9 +41,9 @@ class TransactionInfo {
String _fiatAmount; String _fiatAmount;
String amountFormatted() => '${checkAmount(moneroAmountToString(amount: amount))} XMR'; String amountFormatted() => '${formatAmount(moneroAmountToString(amount: amount))} XMR';
String fiatAmount() => _fiatAmount ?? ''; String fiatAmount() => _fiatAmount ?? '';
void changeFiatAmount(String amount) => _fiatAmount = checkAmount(amount); void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount);
} }

View file

@ -2,7 +2,7 @@ import 'package:hive/hive.dart';
import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart'; import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/src/domain/exchange/trade_state.dart'; import 'package:cake_wallet/src/domain/exchange/trade_state.dart';
import 'package:cake_wallet/src/domain/common/check_amount.dart'; import 'package:cake_wallet/src/domain/common/format_amount.dart';
part 'trade.g.dart'; part 'trade.g.dart';
@ -103,5 +103,5 @@ class Trade extends HiveObject {
}; };
} }
String amountFormatted() => checkAmount(amount); String amountFormatted() => formatAmount(amount);
} }