Jump to content

Credit card monthly balance calculator


colombian

Recommended Posts

I want to make a calculator that shows what your interest rate would be.

The key is that it would output a new row per month with the interest charge, the next payment, etc.

Not the single line, generic ones that are all over the web.

 

Sample:

User inputs:

- Loan amount

- Interest rate

- minimum payment rate (usually between 1-3%)

- monthly payment desired

 

Here is the meat:

The output would return anywhere from 1-400 rows, each explaining the current balance and the interest accrued for that month.

 

I know the formula, I am having problems thinking this through... maybe I've had a long day at work, do send me your suggestions.

 

 

 

 

Link to comment
Share on other sites

Ok, try it this way, imagine that you've got the formula, each row, you use this formula to calculate it for the month (all the data, I'm assuming is based on prior values and current time values).

 

So try a while() loop:

 

$current_balance = $initial_balance;
while($i=0;$i<=$total_months;$++){//where $i is in months
//use the formula to calculate the months
//set $current_balance to whatever you got for this month, etc... so when it loops through again, it has last month's values
echo "<tr><td>Hey look! I'm a row!</td></tr>";
}

 

Hopefully, that might give you a big enough push? I'm not totally perfect on interest/economics stuff (I can define differential equations with it, but that's the extent of my abilities).

 

Maybe you can define what values are needed for each month (generic, IE: previous month values, etc...)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.