padding with spaces
- From: IchBin <weconsul@xxxxxxx>
- Date: Tue, 28 Nov 2006 15:51:44 -0500
I am trying to pad a number with spaces to the left. I can pad it with zeros as in this code:
printf("<option value='%d'>%04s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Trying to do the same with spaces. It is not padding all the spaces but only one space. Right justification:
printf("<option value='%d'>%4s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Even with left justification:
printf("<option value='%d'>%-4s %s</option>n",
$row->id,
$row->NumberOfQuotes,
arrangeName($row->lastName, $row->firstName, $row->middleName, $row->Title, $row->suffix));
Does Anyone have any ideas on what I am doing wrong?
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
______________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
.
- Follow-Ups:
- Re: padding with spaces
- From: Jeff North
- Re: padding with spaces
- From: Jerry Stuckle
- Re: padding with spaces
- Prev by Date: Re: what is the meaning
- Next by Date: Re: padding with spaces
- Previous by thread: Redirect with .htaccess
- Next by thread: Re: padding with spaces
- Index(es):
Relevant Pages
|