2013-12-22 131 views

回答

1

String temp = tv.getText()。toString()。replace。(“,”,“。”); tv.setText(“”+ temp);

+0

我这样做,但我得到例外:'String temp = tv.getText()。toString()。replace(“,”,“。”); \t float f = Float.valueOf(temp); \t extras.putFloat(“sale”,f);' – user2867831

0

当然这不好,因为您必须先删除货币的字符(€,$ ...)。例如,您可以使用String.replace("€", ""),然后使用Float.parseFloat(yourString)