I am trying to translate a C# example of number formatting into Java. The idea is to format the numerical output into 2 “columns” (or 2 characters) for neatness.
With C#, this is done by
Console.WriteLine("{0:00;-0;00}", theInt);
So that 25, 7, -1, 0 prints like:
25
07
-1
00
Is there any good way to do this in Java? (besides writing my own function)
I believe this is what you are looking for.
==> SEE HERE FOR DEMO