title: Edittext convert input value to float in android
body: <p>I have one Edittext.My edittext inputType is  numberDecimal</p>
  
  <pre><code> &lt;EditText
                              android:layout_width="wrap_content"
                              android:layout_height="@dimen/u_widget_height"
                              android:id="@+id/transfer_maney"
                              android:layout_alignParentTop="true"
  
                              android:singleLine="true"
                              android:inputType="numberDecimal"
                              android:hint="Amount"
                              android:layout_alignParentLeft="true"
                              android:layout_alignParentStart="true"
                              android:layout_toLeftOf="@+id/centerline"
                              android:layout_toStartOf="@+id/centerline"
                              android:layout_marginRight="@dimen/u_common_margin_left"
                              /&gt;
  </code></pre>
  
  <p>i want to change input value when  focus finished in my Editytext.i wrote some java code but i have NumberFormatException</p>
  
  <pre><code>  transfer_maney.setOnFocusChangeListener(new View.OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
  
              float inputFloatValue;
              if(!hasFocus)
              {
                  if (TextUtils.isEmpty(contact_search.getText().toString())) {
                      inputFloatValue = 0F;
  
                  } else {
                      inputFloatValue = Float.parseFloat(contact_search.getText().toString().trim());
                      Log.e("inputFloatValue",inputFloatValue+"");
                  }
              }
  
          }
      });
  </code></pre>
  
  <p>simple i want to change input value  integer to float when i finish focus in my Edittext
  if anyone knows solution please help me
  thanks</p>