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.




to zpad :num :width :precision
  output map [ifelse ? = "| | ["0] [?]] form :num :width :precision
end
print zpad 7.125 9 3  ; 00007.125