Hi I\'ve tried everything from terny operators, if else statements and parsing the int to a string, I am making a clock that reads 4:01 4:02 but instead it outputs 4:1
t
Look at Java Tutorial: Formatting Numeric Print Output.
For example:
long n = 461012; System.out.format("%08d%n", n); // --> "00461012"
Another example:
Calendar c = Calendar.getInstance(); System.out.format("%tl:%tM %tp%n", c, c, c); // --> "2:34 am"