title: Android: Restricting textfield to one decimal point
body: <p>How to restrict an EditText Field to only one decimal point. Let's say the user should enter only one digit/number after the <code>(.)[decimal].</code> </p>
  
  <p>User enters : 1.92 <code>[Its invalid]</code>
  User enters : 1.9 <code>[Its Valid]</code></p>
  
  <p>Below is the regular expression i am using. </p>
  
  <pre><code>mPattern = Pattern.compile("[0-9]*+((\\.[0-9]{0," + (digitsAfterZero - 1) + "})?)||(\\.)?");
  </code></pre>
  
  <p>I am having problems with the decimals, user if enter <code>23.1</code> its fine, but the same user can enter <code>2.31</code>. </p>
  
  <p>How can i restrict user to enter only one number/digit after decimal.</p>