Also, 04.2 also prints 7.00.
Yes sorry I forgot about the decimal point.
05.2 will give you
07.00 output.
The thing is, when you say
03.2 (I'm using a different value to make it easier to understand), you are indicating that the number must span at least 3 digits. This includes the number before the decimal point, the decimal point itself and the numbers after the decimal point. Since we have 2 digits after the decimal point, so the length already is more than the minimum length of the number.
Lets say I write
printf("%08.2f",new Double(7)), here I want to print the number 7 with 2 digits after the decimal point and I want it to span at least 8 digits. So the output will be
00007.00 which as you can see spans 8 digits...