Here is the code:
function updateCartSubtotal() {
var subtotal = 0.00;
$('span.item-subtotal-value').each(function () {
subtotal = subtotal + parseFloat($(this).text()); //24.00 for example.
});
console.log(subtotal); // Logs: "144"
$('span.cart-subtotal-value').text(subtotal); //Places: "144" in the .text().
$('span.cart-subtotal').text(subtotal);
}
So what am I doing wrong? Why is this ignoring the two trailing zeroes?
It's adding correctly, just not showing the decimals.