How do I fill in the space of the first column in the following code with 0's?
for(int i = 0; i < 10; i++) {
System.out.printf("%-3.0f %-1s%8.2f%1s %8.2f\n", (double)i, "[", 10d, "]", 10000d);
}
Output:
0 [ 10.00] 10000.00
1 [ 10.00] 10000.00
...
Ouput I want
000 [ 10.00] 10000.00
001 [ 10.00] 10000.00
...