I have a string.
String value = "The value of this product: 13,45 USD";
I want it to be a double which should be like:
double actualprice=13,45;
Or should i use float, double is useless here? Sorry, i am not an expert.
So how can i transform this string to a number?
oh and i almost forgot, i've got a code, which makes it to "13,45" but it's still a String.
String price = "The price is: 13.45";
String s = price;
for(int b=0;b<s.length();b++){
if(s.charAt(b)=='.') {
System.out.print(",");
}
if(Character.isDigit(s.charAt(b))) {
System.out.print(s.charAt(b)+"");
}
}