Task

Express a number in decimal as a fixed-length string with leading zeros.



For example, the number   7.125   could be expressed as   00007.125.




import std.stdio;
 
void main() {
    immutable r = 7.125;
    writefln(" %9.3f",  -r);
    writefln(" %9.3f",   r);
    writefln(" %-9.3f",  r);
    writefln(" %09.3f", -r);
    writefln(" %09.3f",  r);
    writefln(" %-09.3f", r);
}