I have this code and I'm trying to format the output as shown below, but when I start the program and reach to printf, it stops and gives error Exception in thread "main" java.util.IllegalFormatConversionException: f != java.lang.String
variables:
itemcode=integer
selecteditems=string
perkg=double
userkg=string
quantity-integer
dry=string
total=double
Note: those are changeable variables into for loop.
System.out.printf("%-4d %-13s %8.2f %8.2f %-8d %-10s %8.2f %n", itemcode,
selecteditems, per_kg, userkg, quantity, dry, total);
%nas last format specifier?per_kg,userkgtotalarefloatordoubletype? It seems that at leas one of them is String.\r\non windows).