Hi I've got a input string ("154,216.48") with: "," as separator which I should convert to a double
public double calculateNAV()
NumberFormat nf = NumberFormat.getNumberInstance();
String formattedNAV = nf.format(NAV);
java.lang.NumberFormatException: For input string: "154,216.48"
so, how can I convert this value to a double?
I know DecimalFormat with pattern should be able to fix it. But is that the best way to do it.
Indeed what I need is to convert a 12345.6789 to 12345.68. What's the best way to do it? Thanks.