I'm trying to update the "price" field in a product div.
I've managed to sort out the increments, so the price now changes.
However, It doesn't stay in it's format - it returns bad prices, such as: £1.5 as opposed to £1.50 £0.39999999999999996 as opposed to £0.40, etc - I just want it to add the price of a product (£0.50) to the total price at the push of a button.
Here is my JavaScript so far:
function incrementquan'.$row["pid"].'(){
var input = document.getElementById("quan'.$row["pid"].'");
input.value = parseInt(input.value) + 1;
var element = document.getElementById("price'.$row['pid'].'");
element.innerHTML = ("£" + (input.value * '.$row['pprice'].'));
}
Can anyone help me out with this?
Thanks a lot.