I have the following code which outputs incorrectly.
public static void extend(ArrayList priceList, ArrayList quantityList, ArrayList amountList){
for(int i = 0; i < priceList.size(); i++){
amountList.add((Double)priceList.get(i) * (Double)quantityList.get(i));
System.out.println(priceList.get(i) + " * " + quantityList.get(i) + " = " + amountList.get(i) );
}
The output for some of the items is like "18.32 * 5.4 = 98.92800000000001"
I need to round that to two decimal places but everything I try blows everything up.
Advice?