Colleagues

I have numbers like "12012" that I will be printing in a graphic.  I  
would like to format them as follows: 012-012, i.e., the first two  
digits padded to the left by a zero, followed by a dash, followed by  
the final three digits, also padded to the left by zeros.

I can do this with brute force:

FirstPart			<- sprintf("%03d", floor(Number / 1000))
SecondPart		<- sprintf("%03d", WhichID %% 1000)
Combined		<- paste(FirstPart, "-", SecondPart, sep="")

But, I suspect that there is some more clever means to accomplish  
this using formatC or sprintf.  Unfortunately, the help pages don't  
provide sufficient insight.  I would appreciate any tricks to  
accomplish this.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.com


	[[alternative HTML version deleted]]

