Get number from EditText
<p>I want to get an float number from my EditText</p>

<blockquote>
<pre><code>&lt;EditText
    android:id="@+id/et_Amount"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="number" 
    android:hint="Units of fuel you purchased"&gt;

    &lt;requestFocus /&gt;
&lt;/EditText&gt;
</code></pre>
</blockquote>

<p>Here is what I did</p>

<blockquote>
<pre><code>public void setAmount() {
  EditText tx = (EditText) findViewById(R.id.et_Amount);
  float amount = Float.valueOf(tx.getText().toString()); 
}
</code></pre>
</blockquote>

<p>Unfortunately i got NumberFormatException . Any ideas? :wq</p>
