Formatted numeric output

fn main() {
    let n = 7.125;
    println "{n:09.3f}";
}

Output:

00007.125

Attribution: This is a community solution for the Rosetta Code task Formatted numeric output in Zen C.

This article uses material from the Rosetta Code article Formatted numeric output, which is released under the GNU Free Documentation License 1.3. A list of the original authors can be found in the page history.