Try this. I might have the comma 2 ',2' in the wrong place. If so try putting it after the close bracket '), 2'
Private Sub btnInterest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInterest.Click
lstInterest.Items.Clear()
If Interval = "Fortnightly" Then
For P = (Period * 26) - 26 To 0 Step -26
Interest = (Instalment * 26) - (Instalment / ((1 + CalculatedRate) ^ P) * (1 - (1 + CalculatedRate) ^ -26)) / CalculatedRate
lstInterest.Items.Add(Interest)
Next
lstInterest.Items.Add(FormatNumber(Instalment * Period * 26) - Principal, 2)
Else
For P = (Period * 12) - 12 To 0 Step -12
Interest = (Instalment * 12) - (Instalment / ((1 + CalculatedRate) ^ P) * (1 - (1 + CalculatedRate) ^ -12)) / CalculatedRate
lstInterest.Items.Add(Interest)
Next
lstInterest.Items.Add(FormatNumber(Instalment * Period * 12) - Principal, 2)
End If
End Sub
|