title: Calculating Sales Tax in a javascript function
body: <p>I am having trouble calculating tax and then adding it to the subtotal. Just so you are aware I am very new to coding in general. the goal is to have the tirePrice,tireAmount, and tireFees all added up and taxed and then the coupons should be taken off. also if you have any tips to improve let me know but as I said keep in mind I am very new to this.
  Thank you for your time :).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function computePrice() {
      var tirePrice = document.getElementById('tirePrice').value;
      var tireAmount = document.getElementById('tireAmount').value;
      var tireFees = document.getElementById('tireFees').value;
      var tireCoupons = document.getElementById('tireCoupons').value;
      var finalPrice = ((+tirePrice * +tireAmount + +tireFees) * .8 - +tireCoupons).toFixed(2);
      finalPrice = finalPrice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
      document.getElementById('finalPrice').innerHTML = "Total:$" + finalPrice;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
      &lt;title&gt;BJ's Tire Bay Calculator&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;h1&gt;BJ's Tire Bay Calculator &lt;/h1&gt;
      &lt;p&gt;Price Per Tire: $ &lt;input id="tirePrice" type="number" min="1" max="100000"&gt;&lt;/p&gt;
      &lt;p&gt;Number Of Tires: &lt;input id="tireAmount" type="number" min="1" max="4"&gt;&lt;/p&gt;
      &lt;p&gt;Installation Fee and NYS Recycling Fee: $&lt;input id="tireFees" type="number" min="1" max="70"&gt;&lt;/p&gt;
      &lt;p&gt;Coupons: $ &lt;input id="tireCoupons" type="number" max="100000"&gt;&lt;/p&gt;
      &lt;input id="displayNum" value="Calculate" type="button" onclick="computePrice()"&gt;
      &lt;h2 id="finalPrice"&gt;&lt;/h2&gt;
  &lt;/body&gt;
  &lt;script src="index.js"&gt;&lt;/script&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>