Raised This Month: $ Target: $400
 0% 

percent


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2013 , 21:16   Re: percent
Reply With Quote #5

Quote:
Originally Posted by Sylwester View Post
You made a little mistake and also to make it work with integers the formula should look like this:
100 * Earned Achievements / Total Achievements
That won't work. It will perform integer division which will always be 0 in this case (when earned is less than total). You need to float them first and output a floating point value.

PHP Code:
new Float:percent 100.0 float(earned)/float(total
@Yami, you have total and earned backwards.
__________________

Last edited by fysiks; 01-05-2013 at 21:17.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode