in reply to converting digits

Sprintf is your friend.

-fp

Update: Because I have a feeling about what you're going to ask next, I'll mention that printf is also your friend. Sprintf() returns the formatted string. Printf(), on the other hand, prints it to the currently selected filehandle (STDOUT by default).

Update to my Update: Clarified any confusion regarding the use of sprintf and printf for BazB and Sara. The two functions are alternatives, not to be used at the same time. *sigh*

Replies are listed 'Best First'.
Re: Re: converting digits
by BazB (Priest) on Jul 29, 2002 at 06:20 UTC

    Actually, if you're using sprintf to format text, you only need print to output the (formatted) text.
    If you want to format and output in one step, then you should use printf.

      I was simply clarifying the differences between the two functions. That's quite a leap of logic for you to infer that I was suggesting both should be used inclusively. Perhaps next time I'll keep my updates to myself. :-P

      -fp

      Update: BazB, sorry if that sounded confrontational. I just woke up, and didn't grok that I had to explain myself over something so elementary.