CAKE-185 | changed isValidAmount() in the exchange_view_model.dart

This commit is contained in:
OleksandrSobol 2020-11-27 08:50:28 +02:00
parent 4cb4ede2d3
commit 623299b8f6

View file

@ -313,15 +313,8 @@ abstract class ExchangeViewModelBase with Store {
final amount = isReceiveAmountEntered
? receiveAmount
: depositAmount;
final amountParts = amount.replaceAll(',', '.')
.split('.');
final numberOfFractionDigits =
amountParts.length > 1
? amountParts[1].length : 0;
isValid = !(numberOfFractionDigits > 8);
isValid = RegExp('^([0-9]+([.\,][0-9]{0,8})?|[.\,][0-9]{1,8})\$')
.hasMatch(amount);
}
return isValid;