Formatted numeric output: Difference between revisions

Added XPL0 example
(Added XPL0 example)
Line 2,045:
00007.125
</lang>
 
=={{header|XPL0}}==
<lang XPL0>int C;
[Format(5, 3); \5 places before decimal point and 3 after
RlOut(8, 7.125); \output real number to internal buffer
loop [C:= ChIn(8); \read character from internal buffer
if C = ^ then C:= ^0; \change leading space characters to zeros
if C = $1A then quit; \exit loop on end-of-file (EOF = end of chars)
ChOut(0, C); \display digit character on terminal
];
]</lang>
 
{{out}}
<pre>
00007.125
</pre>
 
=={{header|XSLT}}==
772

edits