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.




n = 7.125
:io.fwrite "~f~n", [n]
:io.fwrite "~.3f~n", [n]
:io.fwrite "~9f~n", [n]
:io.fwrite "~9.3f~n", [n]
:io.fwrite "~9..0f~n", [n]
:io.fwrite "~9.3.0f~n", [n]
:io.fwrite "~9.3._f~n", [n]
:io.fwrite "~f~n", [-n]
:io.fwrite "~9.3f~n", [-n]
:io.fwrite "~9.3.0f~n", [-n]
:io.fwrite "~e~n", [n]
:io.fwrite "~12.4e~n", [n]
:io.fwrite "~12.4.0e~n", [n]