Formatted numeric output: Difference between revisions
Added Quackery.
(Added Quackery.) |
(Added Quackery.) |
||
Line 1,914:
=={{header|Quackery}}==
<syntaxhighlight lang="Quackery">
[ over find swap found ] is has ( $ c --> b )
[ over 0 peek
char - = iff
[ 1 -
Line 1,924 ⟶ 1,927:
swap join
swap if
[ char - swap join ] ] is left-pad ( $ n --> $ )
[ over char . has not if
[ dip [ char . join ] ]
over char . swap find
dip [ over size ]
1+ - -
char 0 swap of
join ] is right-pad ( $ n --> $ )
[ dip left-pad right-pad ] is format ( $ n n --> $ )
' [ $ "7.125"
$ "-7.125"
$ "0.125"
$ "-0.
$ "7.12"
$ "-7.12"
$ "0.12"
$ "-0.12"
$ "7"
$ "-7"
$ "0" ]
witheach
[ do 5
{{out}}
Line 1,941 ⟶ 1,958:
-0007.125
00000.125
-0000.
00007.120
-0007.120
00000
-0000.120
00007.000
-0007.000
00000.000</pre>
=={{header|R}}==
|