Android EditText retains two decimal places, androidedittext
Double d = 3.1465926; String result = String. format ("%. 2f", d); System. out. println (result );
Android uses EditText as the amount input box to keep the minimum to the minute, that is, keep the two decimal places in it.
First, set android: numeric = "decimal" in the xml file, and then set the control condition % 0.2d to EditText. setoneditexceptionlistener () in the code. Get the real-time content of Edit in this time, and determine whether the content after the decimal point exceeds two lengths.
Can the history of the last change be retained in android EditText?
Yes. With AutoCompleteTextView, you can set the Adapter and click EditText to have the set content. This depends on how your program is written. After the user inputs, the input content is stored, save it to the database or the place you want to store it, and then start the program and take it out.