mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
CAKE-185 | changed isValidAmount() in the exchange_view_model.dart
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user