Hey everyone, I'm pretty new to the Java code, and am using DrJava right now, and have used JCreator in the past. My question is, how do I output the numbers, say "05" from: 10599 I was thinking something along the lines of output = 10599%1000; but that would only provide me with the "5", yet I want the zero (0) to be included. I'm sure it's quite simple, does anybody know?
Covert number to string. Then you can get 2 character. Then you convert 2 character again into integer
Or use the DecimalFormat function ( http://java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html ). I haven't done Java in a long time, but that should do what you need it to.