Formatted numeric output: Difference between revisions

Added Quackery.
(Added Quackery.)
(Added Quackery.)
Line 1,914:
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ over 0 peek
[ 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.12512"
$ "7.12"
$ "-7.12"
$ "0.12"
$ "-0.12"
$ "7"
$ "-7"
$ "0" ]
witheach
[ do 5 left-pad3 format echo$ cr ]</syntaxhighlight>
 
{{out}}
Line 1,941 ⟶ 1,958:
-0007.125
00000.125
-0000.125120
00007.120
-0007.120
00000</pre>.120
-0000.120
00007.000
-0007.000
00000.000</pre>
 
=={{header|R}}==
1,462

edits