title: Formulating Percentage
body: <p>I'm in the middle of creating a small lua program. In the program I want to calculate the percentage of hits (numPercent) from the number of hits (numHits) and the number of misses (numMiss). </p>
  
  <p>For instance, if I were to hit the target 5 times and missed 0, it would show the percentage as 100% Hits</p>
  
  <p>How would I formulate this problem?</p>
  
  <p>This is what I got so far, which as you can see is completely incorrect. </p>
  
  <pre><code> if ( numHit &gt; numMiss) then --calculates percentage
   numPercent = numHit / numMiss * 100/2
   else
   numPercent = numMiss / numHit * 100/2
   end
  </code></pre>
  
  <p>Could I get some guidance in formulating it correctly? </p>