Why in my jsfiddle the BASE #subtotal is not calculated with decimal, if yo try to put a number with decimal in the numbers ( click over the number, its editable), the BASE does not sum the result with decimal
Here the code i have edited
$('#subtotal').html(total.toFixed(2));
var vat = parseFloat((0.21 * total).toFixed(2));
var irpf = parseFloat((0.15 * total).toFixed(2));
you’ve got a line
total is an int… so no decimals.
replace the line by
parseFloat, or use another var if you need an int result.Updated jsFiddle