k-b0101's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 2 (0 per day)
- Joined:
- 08-November 11
- Profile Views:
- 120
- Last Active:
Dec 04 2011 06:18 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Investment value Calculator-future value is not correct
Posted 18 Nov 2011
g00se, on 18 November 2011 - 06:20 PM, said:Quote
double res = invest * Math.pow((1 + interestrt), (year * 12));
Firstly, if you're entering the interest rate as a percent, e.g. 3.25, then it should be
interestrt/100
and it's not 'year * 12' but just 'year'
double futureValue = invest * Math.pow(1 + (interestrt/100), year); txtRes.setText(String.format("%,.2f", futureValue));
Ok thank you for the help. That is exactly the fix I needed. So by doing inerestrt/100 is made interest rate a %,
and the "%,.2f" gave it the correct decimal place right?
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Click here to e-mail me
Friends
k-b0101 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
k-b0101 has no profile comments yet. Why not say hello?