<p><br>
Am 09.01.2012 12:08 schrieb "ik" <<a href="mailto:idokan@gmail.com">idokan@gmail.com</a>>:<br>
><br>
> Hello,<br>
><br>
> I'm trying to use the Format function to pad a number like so:<br>
> 01<br>
> where the original value is "$1".<br>
><br>
> I tried to do the following:<br>
><br>
> writeln(Format('%02X', [$1]));<br>
> writeln(Format('%0:2X', [$1]));<br>
> writeln(Format('%:2X', [$1]));<br>
><br>
> All of them created the following output:<br>
> " 1"<br>
><br>
> What am I doing wrong ?</p>
<p>You tried nearly everything except %.2X :)</p>
<p>See also the examples here: <a href="http://www.freepascal.org/docs-html/rtl/sysutils/format.html">http://www.freepascal.org/docs-html/rtl/sysutils/format.html</a> </p>
<p>Regards,<br>
Sven</p>