silver32 Posted July 30, 2006 Share Posted July 30, 2006 $xpfornext = 4000$Level[7] = 2000[code]$per = $xpfornext - $Level[7] / $xpfornext * 100;[/code]I always get a 3999.5 but I must be gettting 50, what's the problem and can you suggest any easier/other ways to calculate the percentage. Quote Link to comment https://forums.phpfreaks.com/topic/16025-prob-using-math-operator/ Share on other sites More sharing options...
AndyB Posted July 30, 2006 Share Posted July 30, 2006 Take a closer look at your logic and you'll see why you need to change it to this:[code]$per = $xpfornext - 100 * $level[7] / $xpfornext;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/16025-prob-using-math-operator/#findComment-65906 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.