mardi 14 avril 2015

Hot to show only two digits after decimal using double


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

Ptr

1






Hot to show only two digits after decimal using double

Aucun commentaire:

Enregistrer un commentaire