Thank you for the sprintf, James. This is exactly what I need. 

Yes, you are right about finding the answer just after sending a message. I
spent ages on Google looking for an answer but didn't come across it until
after I'd sent a message to the group. In a way I am pleased it worked that
way because your answer is much better than the one I found! Thank you!

Janet







I was going to read the rest of my emails to see if you received a reply
Already. Someone must have defined a law that the moment you compose a
Question and send it out, the answer will arrive on its own in about the
time
It takes to ask it. :)

Your printf() example is good and along the lines I had in mind. The
str_pad()
May not cover all inputs. You can place the value in a variable with
sprintf()

$padded_value = sprintf("%02d", $input_value);

There are probably three or four other ways to solve this, as with any
simple
Programming problem. I find the sprintf() to be the most readable without
Consulting a function documentation in print or on the Internet.

James

[Non-text portions of this message have been removed]

Reply via email to