Är det någon som har en lösning på detta, ser inte felet men svaret blir felAnnuitetslån
manadskostnad är i denna kod = 2781, men det skall bli 2706
NÅGON, TACK!!!!!!!!!!!!
Protected Function PayAsValue(ByVal CarPrice As Object, ByVal SelectedCarMonth As Object,
ByVal SelectedCarPayment As Object) As String
Dim Totala_Lanet As Integer = 169000
Dim Kontantinsats As Integer = 20 'procent
Dim Ranta As Decimal = 7.45 'Ränta
Dim Avbetalningstid As Integer = 60 ' SelectedCarMonth 'Antal månader
'Dim intSelectedCarPayment As Integer = SelectedCarPayment 'Egen summa
Dim Kreditbelopp As Integer = Totala_Lanet * (1 - Kontantinsats / 100)
Dim Years As Integer = Avbetalningstid / 12
Dim Arskostnad As String = Kreditbelopp * Annuitetslan(Ranta, Years)
Dim manadskostnad As Integer = Arskostnad / 12
Return manadskostnad
End Function
Public Function Annuitetslan(ByVal Ranta As Object, ByVal Years As Object) As String
Dim interestRate As Decimal = Ranta / 100
Dim annuitet As Decimal = interestRate / (1 - (1 + interestRate) ^ -Years.ToString())
Return annuitet
End Function