title: Getting a NaN error, can't figure out why
body: <p>I have this code in JavaScript:</p>
  
  <pre class="lang-js prettyprint-override"><code>SolarPanels = parseInt(lRemainingWidth / (panel_width + ( 2 * lPanelInterSpace)));
  </code></pre>
  
  <p>and then I alert the <code>SolarPanels</code> value which gives <code>NaN</code> as output,</p>
  
  <pre class="lang-js prettyprint-override"><code>alert("SolarPanels "+SolarPanels); 
  </code></pre>
  
  <p>This 1 line is a tiny part of a huge calculation, but my code seems to fail here,
  with the use of alerts i've read out the values of <code>SolarPanels</code>, <code>lRemainingWidth</code>, <code>panel_width</code> and <code>lPanelInterSpace</code>
  which are the following:</p>
  
  <pre><code>lRemainingwidth = 17.4.320227272727276
  SolarPanels = 0
  panel_width = 1.65
  lPanelInterSpace = 0.02
  </code></pre>
  
  <p>I think it has to do with the 2 dots in <code>lRemainingWidth</code>, either way, I don't know how to fix it. Why the <code>lRemainingWidth</code> has 2 dots?</p>
  
  <hr>
  
  <p>Update :</p>
  
  <p>This is the part that calculates the lRemainingWidth :</p>
  
  <pre class="lang-js prettyprint-override"><code>    if(HalforDouble === "Yes")
      {
          lRemainingWidth = (roof_ridge /2) + ((lRemainingHeight / Math.tan((lRoofEdgeDegrees * Math.PI) / 180)) - lRoofEdge);            
      }
  
      else
      {
          lRemainingWidth = roof_ridge + (2 * ((lRemainingHeight / Math.tan((lRoofEdgeDegrees * Math.PI) / 180)) - lRoofEdge));
      }
  </code></pre>
  
  <p>The values here are:</p>
  
  <pre><code>lRemainingWidth = 0
  roof_ridge = 17
  lRemainingHeight = 20.769000000000002
  lRoofEdgeDegrees = 83.5169263071276
  lRoofEdge = 0.2
  </code></pre>