How do you increment number by percents in php? Or, even 1.2 would work (120%) etc?

  • Thread starter Thread starter sour_bank_s
  • Start date Start date
S

sour_bank_s

Guest
User buys an item, and then the next one would cost 35% more.

So a $100 item would cost $135 the next time. Anyone know how to go about this?
Thanks, it hit me after I walked away from the computer. There a few other variables that go into place so that distracted me from the simple solution that I'l probably use a switch function with.

Thanks!
 
Why don't we just multiply the old price with the new factor, example:

$newPrice=$oldPrice * $factor;

Here $factor can be 1.35 or 1.2 etc..

I think this should solve the issue.. no need of any php function provided I have understood your problem properly.. else pardon.
 
Back
Top