How to get a percent value
<p>Okay, so for my website, I made a tests system, where you can take quizes. It all works, but getting the percentage of correct answers is broken.</p>

<p>I have 3 variables I am trying to use to get the percentage.</p>

<pre><code>$incorrect // Int value of incorrect answers
$correct // Int value of correct answers
$perc // Percentage of correct answers from 0 to 100
</code></pre>

<p>Currently, I use this, but it does not work:</p>

<pre><code>if($incorrect===0){
   $perc = 100;
}elseif($correct===0){
   $perc = 0;
}else{
   $perc = ($incorrect / $correct)*100;
}
</code></pre>
