View Problem

Zero pad a number

Given the number 42, pad it to 8 characters like 00000042
ExpandDiskEdit
fantom
formatted := 42.toStr.padl(8, '0')
ExpandDiskEdit
fantom
formatted := 42.toLocale("00000000")

Submit a new solution for fantom
There are 37 other solutions in additional languages (clojure, cpp, csharp, erlang ...)