title: Warning: Division by zero in C:\xampp\htdocs\engine\core.php on line 629
body: <p>I'm new to PHP and I have an error on my website and can't figure out the right way to fix it.</p>
  
  <p>The error:</p>
  
  <pre><code>Warning: Division by zero
  </code></pre>
  
  <p>The code I'm using:</p>
  
  <pre><code>public function percent($num_amount, $num_total)
  {
      $count1 = $num_amount / $num_total;
      $count2 = $count1 * 100;
      $count = round($count2);
  
      return $count;
  }
  </code></pre>
  
  <p>I know it has something to do with dividing by 0 which obviously can't.
  But how do I change that and fix this error?</p>