Basically Im using parsefloat to help add a certain amount to a variable passed on from another page, but now instead of it appearing as 45.50, it appears as 45.5.
Basically I need to have "5" and "4" to be displayed to 2 decimal places. Ive tried using toFixed(2) but i cant seem to get it to work.
Also before anyone mentions, I know the site fails to function as it should on google chrome and some other browsers and Im working on that :)
Code:
var pay=50,res;
document.getElementById("3").innerHTML = p[1];
document.getElementById("77").innerHTML = p[1];
document.getElementById('77').value = document.getElementById('3').innerHTML;
document.getElementById('4').value = document.getElementById('77').innerHTML;
document.getElementById('5').value = document.getElementById('77').innerHTML;
document.getElementById("3").innerHTML = p[1].replace('+', ' ').replace('%C2%A3', '£').replace(' UK', ' ');
document.getElementById("77").innerHTML = p[1].replace('+', ' ').replace('%C2%A3', '£').replace(' UK', ' ');
document.getElementById("4").innerHTML = parseFloat(p[1]) + 5;
res = parseFloat(p[1])*( pay / 100);
document.getElementById("5").innerHTML = parseFloat(p[1]) + res;
Also before anyone mentions, I know the site fails to function as it should on google chrome and some other browsers and Im working on that :)
Comment