Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid radix-10 number (at character 1) when validating input with this formatter #16

Open
giorgio79 opened this issue Apr 5, 2021 · 2 comments

Comments

@giorgio79
Copy link

Just testing this out.

Formatting is great, yet when I go to validate and make sure the number is int I get the error message
Invalid radix-10 number (at character 1)

I am calling
if (int.parse(value) >to validate the value, so it looks like parse is not liking the value

Here is my validator

                                validator: (value) {
                                  if (value.isEmpty) {
                                    return 'Please enter an amount.';
                                  }
                                  if (int.parse(value) >
                                          20) {
                                    return 'Please enter a lower amount. The max you can request is '  + 
                                                20)
                                            .toString();
                                  }

                                  return null;
                                },
@elvissalabarria
Copy link

please put full code snippet

@elvissalabarria
Copy link

validator: (value) {
if (value.isEmpty) {
return 'Please enter an amount.';
}
if (int.parse(value) > 20) {
return 'Please enter a lower amount. The max you can request is 20 ';
}

                            return null;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants