I am doing some sample practice for formatting string using format()
and printf()
methods.
Here is an example, whose output i am confused about please help.
int i2= 12345;
//Total length of the argument should be 7 and pad with zeros
System.out.printf(">%0,7d< \N",i2);
The output is
>012,345<
If we see, the length of the argument is six. But does the delimiter is also counted in its length. If not then the output should have been this according to me.
>001,2345<
Please help in clarifying this doubt.