Formatted numeric output: Difference between revisions
Content added Content deleted
mNo edit summary |
|||
Line 2,365: | Line 2,365: | ||
<pre> |
<pre> |
||
00007.125 |
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> |
</pre> |
||