Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a very simple problem, I need to somehow pad a number to be 4 characters in length so I always end up with a 4 byte word.
For Example:
2 needs to be 0002
15 needs to be 0015
...
I have to have the leading zeroes.
Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reg Exp Suggestion Needed
by theorbtwo (Prior) on Sep 05, 2002 at 01:03 UTC | |
|
Re: Reg Exp Suggestion Needed
by dws (Chancellor) on Sep 05, 2002 at 01:04 UTC | |
|
Re: Reg Exp Suggestion Needed
by dpuu (Chaplain) on Sep 05, 2002 at 01:04 UTC | |
|
Re: Reg Exp Suggestion Needed
by kelan (Deacon) on Sep 05, 2002 at 01:05 UTC | |
|
Re: Reg Exp Suggestion Needed
by Zaxo (Archbishop) on Sep 05, 2002 at 01:04 UTC | |
|
Re: Reg Exp Suggestion Needed
by Anonymous Monk on Sep 05, 2002 at 01:20 UTC | |
|
Re: Reg Exp Suggestion Needed
by AcidHawk (Vicar) on Sep 05, 2002 at 09:41 UTC |