killah Posted May 1, 2009 Share Posted May 1, 2009 I need a math equation that will always work out 10% of a number that is ALWAYS increasing. I tried: $number = 12; echo (($number / 100) * 10); But i have 2 equation's. One for supporters & one for non supporters. The supporters should get 10% while the non supporters should get 5% of $number which increases from time to time. The ((12 / 100) * 10) works out to 1.2 then the ((12 / 100) * 5) work's out to 0.6, which both results into 8% as with my mysql query, it's updating. with 1 for both of them. Is there anyway to either work out 10% or 5% out of 12 and increasing numbers? Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/ Share on other sites More sharing options...
Ken2k7 Posted May 1, 2009 Share Posted May 1, 2009 echo $number * .1; Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/#findComment-823533 Share on other sites More sharing options...
killah Posted May 1, 2009 Author Share Posted May 1, 2009 And what about 5% Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/#findComment-823550 Share on other sites More sharing options...
Daniel0 Posted May 1, 2009 Share Posted May 1, 2009 $number * .05 Learn math before PHP (and learn to post in the correct boards). Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/#findComment-823555 Share on other sites More sharing options...
chmpdog Posted June 26, 2009 Share Posted June 26, 2009 Learn math before PHP (and learn to post in the correct boards). boom! headshot. Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/#findComment-863929 Share on other sites More sharing options...
corbin Posted June 26, 2009 Share Posted June 26, 2009 Edit: Blerh ignore me. Quote Link to comment https://forums.phpfreaks.com/topic/156416-solved-working-out-10-of-a-number-always-increasing/#findComment-863962 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.