Formatted numeric output: Difference between revisions
Content added Content deleted
(Replaced module "strfmt" by the more convenient "strformat" which is now provided by the standard library.) |
No edit summary |
||
Line 2,087: | Line 2,087: | ||
{{out}} |
{{out}} |
||
<pre>00007.125</pre> |
<pre>00007.125</pre> |
||
=={{header|Vala}}== |
|||
<lang Vala>void main() { |
|||
double r = 7.125; |
|||
print(" %9.3f\n", -r); |
|||
print(" %9.3f\n",r); |
|||
print(" %-9.3f\n",r); |
|||
print(" %09.3f\n",-r); |
|||
print(" %09.3f\n",r); |
|||
print(" %-09.3f\n",r); |
|||
}</lang> |
|||
{{out}} |
|||
<pre> |
|||
-7.125 |
|||
7.125 |
|||
7.125 |
|||
-0007.125 |
|||
00007.125 |
|||
7.125 |
|||
<pre> |
|||
=={{header|VBA}}== |
=={{header|VBA}}== |