Vote count:
0
I use: priceTextView.setText(String.format("%2.f",price));
price is double. It works but when I must to retrieve the value from the TextView and convert it to double I get the following error:
java.lang.NumberFormatException: Invalid double: "1,2"
Is there another way to do the same thing and avoid the error?
asked 1 min ago
Hot to show only two digits after decimal using double
Aucun commentaire:
Enregistrer un commentaire