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.




fun format n length
  let n tostr n
  while len n < length
    let n 0 + n
  endwhile
  println n
endfun
 
format 7.125 9