- or download this
For integer conversions, specifying a precision imp
+lies
that the output of the number itself should be zero
+-padded
...
printf '<%10.6x>', 1; # prints "< 000001>"
printf '<%010.6x>', 1; # prints "< 000001>"
printf '<%#10.6x>', 1; # prints "< 0x000001>"
- or download this
printf "<%.2d>\n", 5;
printf "<%02.2d>\n", 4;
...
printf "<%02.0d>\n", 2;
printf "<%0.2d>\n", 1;
printf "<%1.2d>\n", 0;
- or download this
<05>
<04>
...
< 2>
<01>
<00>
- or download this
For integer conversions, specifying a precision imp
+lies that the output of the number itself should be zero-padded to th
+is width:
printf ’<%.6x>’, 1; # prints "<000001>"
printf ’<%#.6x>’, 1; # prints "<0x000001>"
printf ’<%-10.6x>’, 1; # prints "<000001 >"