"Philip Sheard" <[EMAIL PROTECTED]> wrote in message
news:31353@palm-dev-forum...
>
> > There are better ways of padding a string
>
> Indeed there are. If the original string was the output from StrIToA, you
> can just add 1000000000 to the input, then skip the first byte, e.g.
>
> Char buf[10];
> Long n = 1234;
> StrIToA(buf, 1000000000 + n);
>
> then use the string starting at buf + 1.
> 1000000000 should be OK for a Long.
>
>
>

Ofcourse this only works when pad character is '0'.  Also using StrIToA is
not a CPU efficient way of doing it either since it involves DIV
instructions.

Like I said, a simple for loop will suffice.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to