I have a method that prints out the total price as a double after calculating the charge and adding a fee to it.
public static String printWarehouseCharge(Warehouse w[])
{
String wc = "";
for(int i=0; i < 4; i++)
{
// method that calculates charge and returns a double
double warehouseCharge = w[i].calculateWarehouseCharge();
//here the calculateTransportFee method adds a fee and returns the total to be printed
wc = wc+String.format("$%,.2f", w[i].calculateTransportFee(warehouseCharge) +"\n");
}
return wc;
}
Unfortunately I keep getting a format error: IllegalFormatConversionException.
Can anyone help me?
calculateTransportFeemethod do not return a correct float.