This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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.)
as i said. its a large base calculator program, but if i go past 1million it kicks it into scientific notation, from everything ive read it requires formatting for the number to not do that. i need it to give exact numbers, not scientific notation. if needed i can give you the program i got, this is all thats left to finish it. majority of the numbers will be in the hundred millions and the billions so i need it to not display scientific notation.