How will i round margin_total to 3 decimal places?
margin_total = margin_total + parseFloat(marginObj.value); document.getElementById('margin_total').value = margin_total;
Use num.toFixed(d) to convert a number into the String representation of that number in base 10 with d digits after the decimal point, in this case,
num.toFixed(d)
d
margin_total.toFixed(3);
1.4m articles
1.4m replys
5 comments
57.0k users