Hi, I'm trying to add up several numbers using Jquery, I'm using the following script:
tot = parseFloat($(".subtotal").text());
del = parseFloat('7.50');
$(".total").text(parseFloat(tot + del).toFixed(2));
Basically I'm adding a total to a delivery rate to give a final total.
.subtotal is just a span <span class="subtotal">123</span> and then there is another span for .total which gets updated to correct amount.
This works fine until I get a subtotal of more than 1000 and then it rounds the number down to 1??
Can anyone shed any light?