Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-4462
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Sep 8, 2023
1 parent 45aa580 commit 08e89c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/mgramseva/lib/utils/validators/validators.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:mgramseva/utils/constants/i18_key_constants.dart';
import 'package:mgramseva/utils/localization/application_localizations.dart';
import 'package:mgramseva/utils/global_variables.dart';
import 'dart:math' as math;

class Validators {
static validate(value, type) {
Expand Down Expand Up @@ -109,7 +110,7 @@ class Validators {
static String? amountValidator(String? v) {
if (v!.trim().isEmpty) {
return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.expense.AMOUNT_MENTIONED_IN_THE_BILL)}';
} else if (double.parse(v) <= 0) {
} else if (double.parse(v) <= 0 || (((math.log(double.parse(v!)) / math.ln10) + 1) as int) > 6) {
return '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.expense.ENTER_VALID_AMOUNT)}';
}
return null;
Expand Down

0 comments on commit 08e89c7

Please sign in to comment.