padding with spaces



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-)
.



Relevant Pages

  • Re: Right Justify amounts
    ... files then maybe you can pad the strings as they go to text file so ... I would convert to string and then pad the length at the start with " " ... Justification of data is a controlled> through whatever client tool you use to view the data. ... You> would control display behavior through a client app, not on> a transformation. ...
    (microsoft.public.sqlserver.dts)
  • Re: Noob question re: roman chairs/back hyperextensions
    ... Are you saying that the flat pad is not comfortable ... > had been using a hyperextension bench at my gym for two years. ... just as when you were positioned doing regular ... > hypers, but your legs are sort of twisted. ...
    (misc.fitness.weights)
  • Interpolation And Low-Pass filtering
    ... I read that while interpolaton for upsampling we pad zeros (their ... You are basically moving "non-zero" frequency components into the ...
    (comp.dsp)
  • RE: Incrementing data and storing in field
    ... "paduanow" wrote: ... A number field does not have leading zeros. ... I could use an Auto ...
    (microsoft.public.access.forms)
  • Google search tips please was[Re: Zero padding the frequency spectrum]
    ... As far as I have understood the FFT, it is sometimes beneficial to pad ... the time-signal with zeros to achieve an increased "resolution" (I know ... interpolation that takes place). ... with zeros to make it 1024 samples long. ...
    (comp.dsp)