Strings In Depth8 / 12
Up next

formatC

# formatC gives fine-grained numeric formatting
print(formatC(3.14159, format = "f", digits = 2))
# pad an integer to width 6 with zeros
print(formatC(42, width = 6, flag = "0"))
What you're solving

width, padding and precision