Is there a Java API or built-in function to solve annuity problems?

My boss asked me to create a module for calculating the reverse connection.

Question: if I want to reach $ 1,000,000.00 within 24 months with an interest rate of 18% per year (or 1.5% per month). how much money should i save every month?

I searched the Internet but found nothing but people referring to an Excel formula. Do you know what a mathematical formula is for this case?

I am using Java for this module. Is there a Java library or API?

+3
source share
4 answers

, D M , r, . i = r / 12. M

D * (1 + i)^M + D * (1 + i)^(M - 1) + D * (1 + i)^(M - 2) + ...
    D * (1 + i)

. , D M , D M-1 ..

D * (1 + i) * ((1 + i)^M - 1) / i.

, X M ,

X = D * (1 + i) * ((1 + i)^M - 1) / i

D,

D = X * i / ((1 + i) * ((1 + i)^M - 1)).

API , , . , , , , - .

+14

, , , , .

, . , , (, , APR).

:

  • .
  • .
  • , , , .

, .

+4

the formula you want is S = R * [(1+i)^n - 1] / iwhere

S = the required amount at the end (1,000,000)
R = the regular payment (what you want)
i = the periodic rate of interest (0.015)
n = the number of time periods (24)

so your answer is R = 1,000,000 * .015 / (1.015 ^ 24 - 1) (~ = 34924.10)

EDIT:

This assumes that payments are at the end of each period, if payments are made at the beginning of each period, then divide your answer by (1 + i)

+4
source

I think this one gets what you want. Its even LGPL, although if you get 18% profit on your money, the price should not matter; -).

+2
source

Source: https://habr.com/ru/post/1712859/


All Articles