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 , 23:17   Re: percent
Reply With Quote #7

I didn't say anything about order of operations.

3 / 5 = 0
3.0 / 5.0 = 0.6

Both variables need to be converted to floating point values before they can be divided. To get an integer as an output you would need to do this:

PHP Code:
    new percent floatround(float(earned)/float(total)*100.0
__________________
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