Formatted numeric output: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|APL}}: Regularize non-standard header markup) |
(Replaced module "strfmt" by the more convenient "strformat" which is now provided by the standard library.) |
||
Line 1,426: | Line 1,426: | ||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
<lang nim>import |
<lang nim>import strformat |
||
const r = 7.125 |
const r = 7.125 |
||
echo r |
echo r |
||
echo |
echo fmt"{-r:9.3f}" |
||
echo |
echo fmt"{r:9.3f}" |
||
echo |
echo fmt"{-r:09.3f}" |
||
echo |
echo fmt"{r:09.3f}"</lang> |
||
{{out}} |
{{out}} |
||
<pre>7. |
<pre>7.125 |
||
-7.125 |
-7.125 |
||
7.125 |
7.125 |