proration(old_price, new_price, days_used, cycle_days) returning the charge: unused fraction of the cycle × (new − old), rounded to 2 decimals, floored at 0 (downgrades credit differently — not here).proration(500, 900, 10, 30)
266.67
20/30 of the cycle remains: (2/3)×400.
remaining = (cycle_days - days_used) / cycle_days.
max(0, ...) guards downgrades.