- Calculate the fraction of the period used to this point under the previous plan,
x.
3 days /30 days = 0.1 = x
Note: This is approximate, since months can have different numbers of days, there are leap years, etc.
- Multiply
xby the previous plan's billing amount,amount_prevto get how much to credit the customer back,credit.
credit = x * amount_prev = 0.1 * 10 = 1
- Calculate the % of the period not used to this point under the previous plan,
y = 1 - x.
1 - x = y 0.10 = 0.90 = y
- Multiply
yby the new plan's billing amount,amountto get how much to charge the customer,charge.
y * amount = charge = 0.90 * 20 = 18
- Subtract
creditfromchargefor the proratedtotal:
charge - credit = total = 18 - 1 = 17
So, in this example, you would expect to be charged an additional $17 (approximate) for this first billing cycle under the new plan.