-1

How do i write to get to decimals in the line with results? It calculates right but I want 2 decimals as the result.

<script>
            function divideBy() 
            { 
                    num1 = document.getElementById("odds").value;
                    num2 = document.getElementById("gameNumber").value;
                    num3 = document.getElementById("standardBet").value;
            document.getElementById("result").innerHTML = ((num3 * num2)*1.9) / num1;
            }
 </script>
umebon
  • 1
  • 2

1 Answers1

0

You can use toFixed()

(((num3 * num2)*1.9) / num1).toFixed(2);
Tushar Shahi
  • 16,452
  • 1
  • 18
  • 39