title: Whats wrong with this javascript?
body: <p>My assignment was to make a miles to javascript converter using a function, but it's not working. 
  What did I do wrong?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Script 3&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script&gt;
  
          var miles = prompt("Enter distance in miles, or 0 to exit: ","0");
          if (miles == 0){
              alert("Thanks for visiting.");
          } else {
  
              alert(miles + " miles is equal to " + mi_to_km(miles) + " kilometers.");
          }
          function mi_to_km(miles){
              var km = parseInt(miles) * 1.60934;
              return km.ToFixed(2);
          }
  
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>