<div>Try</div><div> </div><div>writeln(Format('%.2x', [$1]));<br><br></div><div class="gmail_quote">On Mon, Jan 9, 2012 at 12:07 PM, ik <span dir="ltr"><<a href="mailto:idokan@gmail.com">idokan@gmail.com</a>></span> wrote:<br>

<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div dir="ltr">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 ?<br><br>Thanks,<br>Ido<br><br><br><br>
</div>
<br>_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br>