- 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
x
by the previous plan's billing amount,amount_prev
to 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
y
by the new plan's billing amount,amount
to get how much to charge the customer,charge
.
y * amount = charge = 0.90 * 20 = 18
- Subtract
credit
fromcharge
for 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.