I need set max input of integer (7), and max inut of decimal (2). Example: 7777777.77, at this moment I’ using Regex for integer, but how can I set input user for decimal??
editText.setFilters(new InputFilter[] { new InputFilter.LengthFilter(7) });
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basic regex pattern would be
However if your regex engine supports negative lookahead and you want to prevent unwanted leading zeros, such as
000123.45, then use patternAnd if you want to allow numbers with decimal point and no traling numbers, such as
123., then replace{1,2}part with{0,2}.