Wonderland
05-27-2004, 10:51 PM
I have read the rounding forums but am still unsure how to incorporate it into my code.
function calculateResult(){
var pcintX = document.form1.x.value;
var pcintY = document.form1.y.value;
var pcintZ = ((pcintX * pcintX)*90.69)/(pcintY * pcintY);
document.form1.z.value = pcintZ;
return false;
}
I need the calculation to round the pcintZ value to 2 decimal places.
Any help on how I could do this?
Thank you
function calculateResult(){
var pcintX = document.form1.x.value;
var pcintY = document.form1.y.value;
var pcintZ = ((pcintX * pcintX)*90.69)/(pcintY * pcintY);
document.form1.z.value = pcintZ;
return false;
}
I need the calculation to round the pcintZ value to 2 decimal places.
Any help on how I could do this?
Thank you