Jump to content

Archived

This topic is now archived and is closed to further replies.

silver32

prob using math operator

Recommended Posts

$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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.