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.




link printf
 
procedure main()
 
every  r := &pi | -r | 100-r do {
  write(r," <=== no printf")
  every p := "|%r|" | "|%9.3r|" | "|%-9.3r|" | "|%0.3r|" | "|%e|" | "|%d|" do 
     write(sprintf(p,r)," <=== sprintf ",p)
} 
end