Need assistance with some calculations:
#1

Basically I'm trying to calculate the rate of inflation to apply that to everything in my server so:


Say the total amount in the server this month is: $1000.

Next month it's $2000.

That's a 100% increase, right?

How do I add that to each item. I.e

Say a cellphone costs $100, How do I add the rate of inflation to that amount if it's $100 increase? Would it be $200 now instead of $100?

How do I actually calculate it in code?
Reply
#2

Ok basically to get an increase in percentage you need an equation which is

Код:
Inflation Rate = ((Current Value - Starting Value) / Starting Value) * 100
Now for getting each item's value as an increase, you should

Код:
New Item Value = (Current Item Value) * Inflation Rate / 100
EDIT: Missed something in the equation
Reply
#3

PERFECT.

Thank you + REP.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)