Title: Division by zero
Last modified: January 6, 2017

---

# Division by zero

 *  [dawidxx7](https://wordpress.org/support/users/dawidxx7/)
 * (@dawidxx7)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/division-by-zero-9/)
 * At a file wp-content/plugins/rating-box/includes/site.php
    there is an error 
   in 60th line. There is an if:
 *     ```
       if( is_object($row) ){
       	$star_value = round(intval($row->total)/intval($row->count),0);
       }
       ```
   
 * When the intval($row->count) equals zero then the “division by zero” error appears
   in posts where the ratingbox is included. I have changed the code like that:
 *     ```
       if( is_object($row) && intval($row->count) != 0){
       	$star_value = round(intval($row->total)/intval($row->count),0);
       }
       ```
   
 * and there is no problem now.
    -  This topic was modified 9 years, 5 months ago by [dawidxx7](https://wordpress.org/support/users/dawidxx7/).

The topic ‘Division by zero’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rating-box_ffffff.svg)
 * [Rating Box](https://wordpress.org/plugins/rating-box/)
 * [Support Threads](https://wordpress.org/support/plugin/rating-box/)
 * [Active Topics](https://wordpress.org/support/plugin/rating-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rating-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rating-box/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [dawidxx7](https://wordpress.org/support/users/dawidxx7/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/division-by-zero-9/)
 * Status: not resolved