Javascript-Round number to decimal

Hi,

I would like to round a calculated value (var Sum) to 4 decimal spots. The JavaScript formula I am using to get the value is below:


<script type="text/javascript">

function calc()
{
var Sum = 0;
Sum = Number(document.getElementById("Q3_r1").value)
* Number(document.getElementById("Q3_r2").value/ [% Q1 * Q2 * 52 %])
document.getElementById("Q3_Total").value = Sum;
}
</script>



Does anyone know how to round the Total sum?

Best,

Katie

Resolved
1 reply