I have the following code which calculates an output based on a select box and outputs to html via
the problem is that it only outputs to 1 decimal place and i would like it output to 2 decimal places i.e. .00 , the function is given below
I have tried toFixed and toPrecision but to no avail due to lack of js experience.
Any suggestions?
Thanks
Code:
<b id='BaconBaguettesTotal'></b>
Code:
function ddd(){
var d=document.getElementById("d")
document.getElementById("BaconBaguettesTotal").innerHTML = d.options[d.selectedIndex].value * 1.80
}
Any suggestions?
Thanks