Need help on this working properly... it outputs a wrong result.. is it just the math operation at the bottom? What should the equation read as? private JButton buttonCalc; public Calculato...
I don't think so. I don't want it to. 12751.16753711824 is definately not a good thing tho. Monthly payment of 12,751 for $350,000 over 30 years on 7 percent interest rate is WAY off to say the ...
What I mean is, you should multiply the term variable by 12 before plugging it into your formula. That 12,000 figure is definitely wrong. It should be around $2300.
If the mentioned changes are applied to now read as: double term = Integer.parseInt(textFieldTerm.getText()) r[/ 12]r; double rate = Double.parseDouble(textFieldRate.getText()) / r[1200]r; dou...
I tried get the output of the result to show just two numbers after the decimal, but can't get it to. What do I have to do?
Instead of using: g[textFieldResult.setText(Double.toString(result));]g in the setResultValue method try the following: g[DecimalFormat myFormat = new DecimalFormat("#,###,###,##0.00"); S...
Calculator.java:72: cannot find symbol symbol : class DecimalFormat location: class Calculator DecimalFormat myFormat = new DecimalFormat("#,###,###,##0.00"); ^ Calculator.java:72: cann...
Hmm... Looks like I was reading the javadoc wrong. Try this:
DecimalFormat myFormat = new DecimalFormat("#,###,###,##0.00");
textFieldResult.setText(myFormat.format(result));
I even tested this this time, and it worked for me.
Big thanks mate. That did the trick.