We don't bite newbies here... much | |
PerlMonks |
printf numificationby YuckFoo (Abbot) |
on Sep 27, 2004 at 17:53 UTC ( [id://394266]=perlquestion: print w/replies, xml ) | Need Help?? |
YuckFoo has asked for the wisdom of the Perl Monks concerning the following question:
I want to take a string and format the leading integer part to four decimal
places with leading 0s ('42a' should become '0042'). I considered regex
parsing the string to get the leading digits, but that seemed unnecessary
because printf and sprintf should DWIM and numify the string that way
anyway. But they didn't. The '%d' format didn't cause numification. Oddly enough the '%f' format did numify: This is perl, v5.6.0 built for i386-linux, so I tried to scan some online perldelta to see if this has been addressed. I didn't find anything, but I'm not really confident that I looked in all the right places. So has *printf numification changed? And what resource is best, easiest, to find this out? YuckNummy
Back to
Seekers of Perl Wisdom
|
|