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.




r = 7.125
printf " %9.3f\n",   r          #=>      7.125
printf " %09.3f\n",  r          #=>  00007.125
printf " %09.3f\n", -r          #=>  -0007.125
printf " %+09.3f\n", r          #=>  +0007.125
puts " %9.3f"  %  r             #=>      7.125
puts " %09.3f" %  r             #=>  00007.125
puts " %09.3f" % -r             #=>  -0007.125
puts " %+09.3f" % r             #=>  +0007.125