.cs
int loan_amt = Int32.Parse(txtLoan_Amount.Text);
double Int_rate = Double.Parse(TxtInterest_Rate.Text);
string freq = DdlFrequency.SelectedItem.Text;
int duration = Int32.Parse(txtDuration.Text);
double Remaining_amt = Int32.Parse( txtLoan_Amount.Text);
while (Remaining_amt > 0)
{
for(int i =1; i<= duration; i++)
{
double monthly_installment = Math.Round(Financial.Pmt((Int_rate / 100) / 12, duration, -(loan_amt)), 0, MidpointRounding.AwayFromZero);
double interest_amt= Math.Round((Remaining_amt * Int_rate )/100/12 ,0,MidpointRounding.AwayFromZero);
GridView1.Rows[i].Cells[1].Text = i.ToString();
Remaining_amt= Remaining_amt- (monthly_installment-interest_amt);
GridView1.Rows[i].Cells[2].Text = Remaining_amt.ToString();
GridView1.Rows[i].Cells[3].Text = (monthly_installment - interest_amt).ToString();
GridView1.Rows[i].Cells[4].Text = interest_amt.ToString();
GridView1.Rows[i].Cells[5].Text = "";
}
}
double Int_rate = Double.Parse(TxtInterest_Rate.Text);
string freq = DdlFrequency.SelectedItem.Text;
int duration = Int32.Parse(txtDuration.Text);
double Remaining_amt = Int32.Parse( txtLoan_Amount.Text);
while (Remaining_amt > 0)
{
for(int i =1; i<= duration; i++)
{
double monthly_installment = Math.Round(Financial.Pmt((Int_rate / 100) / 12, duration, -(loan_amt)), 0, MidpointRounding.AwayFromZero);
double interest_amt= Math.Round((Remaining_amt * Int_rate )/100/12 ,0,MidpointRounding.AwayFromZero);
GridView1.Rows[i].Cells[1].Text = i.ToString();
Remaining_amt= Remaining_amt- (monthly_installment-interest_amt);
GridView1.Rows[i].Cells[2].Text = Remaining_amt.ToString();
GridView1.Rows[i].Cells[3].Text = (monthly_installment - interest_amt).ToString();
GridView1.Rows[i].Cells[4].Text = interest_amt.ToString();
GridView1.Rows[i].Cells[5].Text = "";
}
}
.aspx

JohnRank #2,322 · 608 reputationPosted Jul 16, 2016, 12:30 AM EDT
JohnRank #2,322 · 608 reputationPosted Jul 15, 2016, 10:38 PM EDT
Remaining_amt= Remaining_amt- (monthly_installment-interest_amt);
GridView1.Rows[i].Cells[1].Text = Remaining_amt.ToString();
GridView1.Rows[i].Cells[2].Text = (monthly_installment - interest_amt).ToString();
GridView1.Rows[i].Cells[3].Text = interest_amt.ToString();
GridView1.Rows[i].Cells[4].Text = "";
Sharad MishraRank #6,924 · 253 reputationPosted Jul 15, 2016, 10:52 PM EDT
JohnRank #2,322 · 608 reputationPosted Jul 15, 2016, 10:55 PM EDT
Sharad MishraRank #6,924 · 253 reputationPosted Jul 15, 2016, 11:08 PM EDT
Sharad MishraRank #6,924 · 253 reputationPosted Jul 15, 2016, 11:09 PM EDT
double Int_rate = Double.Parse(TxtInterest_Rate.Text);
string freq = DdlFrequency.SelectedItem.Text;
int duration = Int32.Parse(txtDuration.Text);
double Remaining_amt = Int32.Parse( txtLoan_Amount.Text);