title: How to limit user to input max 2 or 3 digits after decimal separator in EditText(Xamarin.Android)?
body: <p>I have the following class:</p>
  
  <pre><code>public class DecimalFilter : Java.Lang.Object, IInputFilter
  {
      //Pattern mPattern;
      String regex = "[0-9]+((\\.[0-9]{0," + (2 - 1) + "})?)||(\\.)?";
      public DecimalFilter(int digitsAfterZero)
      {
          //mPattern = Pattern.compile("[0-9]+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
          regex = "[0-9]+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?";
      }
  
      public Java.Lang.ICharSequence FilterFormatted(Java.Lang.ICharSequence source, int start, int end, ISpanned dest, int dstart, int dend)
      {
          if (System.Text.RegularExpressions.Regex.IsMatch(dest.ToString(), regex))
          {
              return new Java.Lang.String(string.Empty);
          }
          return null;
      }
  }
  </code></pre>
  
  <p>I have two EditText on which I set the filter like that:</p>
  
  <pre><code>discountEditText.SetFilters(new IInputFilter[] { new DecimalFilter(2) });
  quantityEditText.SetFilters(new IInputFilter[] { new DecimalFilter(3) });
  </code></pre>
  
  <p>When I run the application and try to input something in these EditTexts I am not able to enter even a single number.</p>