// To force decimal to use only two numbers after coma, you can use this
var numberOne = 4.05;
var numberTwo = 3;
// If you use only this :
var total = numberOne * numberTwo; // This will be 12.149999999999999 (thanks JS...)
// But if you use this :
var total = Number(numberOne * numberTwo).toFixed(2); // This will be 12.15
(<number>).toFixed(<Number of decimal places required>);
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>The toPrecision() Method</h2>
<p>toPrecision() formats a number to a specified length:</p>
<p id="demo"></p>
<script>
let num = 0.001658853;
document.getElementById("demo").innerHTML =
num.toPrecision(2) + "<br>" +
num.toPrecision(3) + "<br>" +
num.toPrecision(10);
</script>
</body>
</html>