title: how can I input decimals in to input field - android
body: <p>I'm just starting to play around with android app.
  I have an text field to input numbers but somehow I can only type in regular integers without decimals.</p>
  
  <p>any idea what I can do so I can input decimals too?</p>
  
  <p>This is what I have..</p>
  
  <pre><code>public void onClick(View arg0) {
            EditText edit = (EditText)findViewById(R.id.editText1);
            TextView text = (TextView)findViewById(R.id.textView1);
            String input = edit.getText().toString();
            float num = 0;
            try {
               num = Integer.parseInt(input);
            } catch (NumberFormatException e) {
               input = "0";
            }
  
            double newNum = num * 1.12;
            DecimalFormat df = new DecimalFormat("###.##");
            text.setText(input + " * 12% = " + df.format(newNum));
  </code></pre>