I just wanted to calculate the VAT, but when i divide by 100 to obtain the total price (price*VAT/100), but it returns me 0.0. Here\'s my code:
a.pri
You have to cast your integers, otherwise your result will be computed as an integer before being assigned to a.total. Something like:
a.total
a.total = (float)(a.precio) * (float)(a.iva) / 100;