Nick G Posted March 15, 2008 Share Posted March 15, 2008 Hey, I just got a quick problem here. The quick version: I want to put a point/experience program on my site. Every 10 points (or so) your level goes up one. What would be the best way to do this? Is there a way to check and see if the points are an equivalent of 10? Cause that would be the ideal option. Thanks for any help! Link to comment https://forums.phpfreaks.com/topic/96270-finding-equivalents/ Share on other sites More sharing options...
Nick G Posted March 15, 2008 Author Share Posted March 15, 2008 Nevermind, I figured it out. For anyone interested, here's how. On the user profile (or wherever the level is seen) just put: $userLevel = number_format ($userPoints / 10); Divide the userPoints (by whatever number you want) then just use number format to not show decimals Link to comment https://forums.phpfreaks.com/topic/96270-finding-equivalents/#findComment-492808 Share on other sites More sharing options...
Barand Posted March 15, 2008 Share Posted March 15, 2008 or $userlevel = floor($points/10) Link to comment https://forums.phpfreaks.com/topic/96270-finding-equivalents/#findComment-492853 Share on other sites More sharing options...
Nick G Posted March 16, 2008 Author Share Posted March 16, 2008 Thanks, that actually worked better. I noticed the way I did it rounded up. I appreciate the help! Link to comment https://forums.phpfreaks.com/topic/96270-finding-equivalents/#findComment-493255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.