Treatment when converting given

Asked

Viewed 15 times

1

Guys want to convert String to Double already know how to do, but my string has ,(comma) and the double does not accept, how do I turn this comma into a dot? someone can help me?

1 answer

1


Replace takes the first item and replaces it with the second in the applied variable.

string = string.replace(",", ".");
  • mano, have to explain better pq gave error here, I put String = txt.replace(",","."); txt is my string it has the value I want to treat

  • got now gave.

  • as I would in this case: txtSaldo.setText(); = txtSaldo.gettext(). toString(). replace(",", ".").

Browser other questions tagged

You are not signed in. Login or sign up in order to post.