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. 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] Link to comment https://forums.phpfreaks.com/topic/16025-prob-using-math-operator/#findComment-65906 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.