In the next workbook, one of your instructions is to copy this method:
protected double round(double amount) { DecimalFormat formatter = new DecimalFormat("#.##"); return Double.parseDouble(formatter.format(amount)); }
If you live in Europe or Asia, your Locale
probably uses ,
for decimals. You will need to set your DecimalFormat
's Locale
to English.
protected double round(double amount) { DecimalFormat formatter = new DecimalFormat("#.##", new DecimalFormatSymbols(Locale.ENGLISH)); return Double.parseDouble(formatter.format(amount)); }