how to set the number format for an EditText
I want the number being displayed in my EditText upto 1 decimal place with no leading zeroes e.g. 25.0 not like 025.0 how can i do this? this is in android You can use DecimalFormat DecimalFormat format = new DecimalFormat("##.#"); String formattedText = format.format(025.0); editText.setText(formattedText); You will get result in EditText as 25.0 you can set it in xml file. Like <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/imageView1" android:layout_below="@+id/imageView1" android:layout