A. Pelicker
0
Q:

transformer un string en double java

String s = "10.1";
Double d = Double.parseDouble(s);
1
double d = Double.parseDouble(aString);
1
String text = "12.34"; // example String
double value = Double.parseDouble(text);
0
double total = Double.parseDouble(jlbTotal.getText());
double price = Double.parseDouble(jlbPrice.getText());
0
String number = "123,321";
double value = Double.parseDouble( number.replace(",",".") );
0
String doubleAsString = "23.23";
BigDecimal price = new BigDecimal(doubleAsString);
BigDecimal total = price.plus(anotherPrice);
0

New to Communities?

Join the community