Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: How to zero-pad hex values in sprintf()?

by blue_cowdawg (Monsignor)
on Jan 18, 2013 at 21:11 UTC ( #1014131=note: print w/ replies, xml ) Need Help??

in reply to How to zero-pad hex values in sprintf()?

      am I crazy or do printf() and sprintf() have no way to return, say, 0F instead of just F?

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.

$ perl -e 'printf "%0.4x\n",128;' 0080

Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Comment on Re: How to zero-pad hex values in sprintf()?
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014131]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-11-29 01:31 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls