title: How to format the input of EditText when typing with thousands separators (,) in Android?
body: <p>I've an <code>edittext</code> , it only gets numeric without decimal numbers. </p>
  
  <pre><code>android:inputType="number"
  </code></pre>
  
  <p>I want to separate thousands while I'm typing . For example 25,000 . </p>
  
  <p>I know I should use <code>TextWatcher</code> and I've used this code but I couldn't make it work :</p>
  
  <pre><code>@Override
          public void afterTextChanged(Editable viewss) {
              String s = null;
              try {
                  // The comma in the format specifier does the trick
                  s = String.format("%,d", Long.parseLong(viewss.toString()));
              } catch (NumberFormatException e) {
              }
  
          }
  </code></pre>
  
  <p>Could you help me to do so ?</p>