double total = item.price * item.quantity;
if (item.isTaxed == 1) {
total *= TAX + 1;
}
return total;
Consider this; item.price equals 10.99 and item.quantity = 50 and isTaxed evaluates to true.
I want my output to be 620.94 as the total but instead it's giving me 620.93
How do I fix this?
I tried multiplying total by 100 and storing it in an integer and casting back to a double it gives me 620.94 but I get other problems with a validator I'm working with.