mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
CAKE-185 | changed isValidAmount() in the exchange_view_model.dart
This commit is contained in:
parent
4cb4ede2d3
commit
623299b8f6
1 changed files with 2 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue