Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by blue_cowdawg (Monsignor)
on Jan 18, 2013 at 21:11 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found