Morgan Posted November 12, 2016 Report Share Posted November 12, 2016 (edited) PHP Warning: Division by zero in /home/sasvirtualgroup/public_html/crew.sasvirtualgroup.com/lib/skins/skinname/frontpage_main.tpl on line 146 hello all i keep getting this error please help note = then code on line 146 is $percent = round(((100 * $hours_in_rank)/$difference)); Edited November 12, 2016 by Morgan Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted November 12, 2016 Moderators Report Share Posted November 12, 2016 It means that $difference variable is 0. And based on maths, you can't divide something by 0. You can add an if statement before line 146 which is the following: if($difference == 0) $difference = 1; But I do not know if it is going to affect the results you wish to show. 1 Quote Link to comment Share on other sites More sharing options...
Morgan Posted November 12, 2016 Author Report Share Posted November 12, 2016 thank you this fixed it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.