ok, so ive been working on a calculator program, and if i dare exceed 1 million it puts it into scientific notation. from looking around i tried the
import java.math.*; import java.text.*; thing with NumberFormat blah = new DecimalFormat(); and setting it to ("############");
and adding the blah.formatter(whatever output is here); that seems to appear everywhere i look. but after compiling then running the program. and inputing the values i need. i get this upon it trying to calculate it.
Exception in
thread "main" java.lang.IllegalArgumentException: Cannot format giv
en Object as a Number
at java.text.DecimalFormat.format(DecimalFormat.java:480)
at java.text.Format.format(Format.java:133)
at BlueprintCalculatorTEST.run(BlueprintCalculatorTEST.java:102)
at acm.program.Program.runHook(Program.java)
at acm.program.Program.startRun(Program.java)
at acm.program.Program.start(Program.java)
at acm.program.Program.start(Program.java)
at acm.program.Program.main(Program.java)
any suggestions would be grand and much appreciated. (and theres no Doubles or anything. its JUST int's considering that the calculator is used for things that never have a decimal.)