Formatted numeric output: Difference between revisions
m
no edit summary
mNo edit summary |
|||
Line 2,365:
<pre>
00007.125
</pre>
=={{header|V (Vlang)}}==
<syntaxhighlight lang="Zig">
fn main() {
// refer to string interpolation and format place holding in documentation
// pad with zeros towards the left
num := 7.125
println("${num:09f}")
}
</syntaxhighlight>
{{out}}
<pre>
00007.125
</pre>
|