<?xml version="1.0" encoding="windows-1252"?>
<node id="1014131" title="Re: How to zero-pad hex values in sprintf()?" created="2013-01-18 16:11:30" updated="2013-01-18 16:11:30">
<type id="11">
note</type>
<author id="72516">
blue_cowdawg</author>
<data>
<field name="doctext">
&lt;ul&gt;&lt;ul&gt;&lt;i&gt;
am I crazy or do printf() and sprintf() have no way to return, say, 0F instead of just F?
&lt;/i&gt;&lt;/ul&gt;&lt;/ul&gt;
&lt;p&gt;
I'm not a psychiatrist and never played one on TV so I can't judge if you're crazy or not. But check out this sniglet of code.
&lt;code&gt;
$ perl -e 'printf "%0.4x\n",128;'
0080

&lt;/code&gt;

&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-72516"&gt;
&lt;hr&gt;
&lt;font size="-2"&gt;

Peter L. Berghold  -- Unix Professional&lt;br&gt;
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg&lt;br&gt;
&lt;/font&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1014126</field>
<field name="parent_node">
1014126</field>
</data>
</node>
