View Problem

Right Space pad a number

Given the number 1024 right pad it to 6 characters "1024  "
DiskEdit
groovy
println 1024.toString().padRight(6)
DiskEdit
groovy
formatted = sprintf("%-6d", 1024)

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