Wes Gamble wrote: > Thanks for the comprehensive response. > > Well, I can't really argue with the C implementation, of course... > > BUT > > it feels like if I declare my intent to interpret the sprintf input as a > _decimal_ number with %d (there's a %o if I wanted octal), that is > should allow for leading zeroes. > > My intent in writing sprintf("%d", '08') is to say take the string 08 > and turn it into the number 8. > > It isn't to say here's an octal number, please convert it to decimal for > me. If I think the string is octal, I'll use %o for that. > > So in the spirit of what the user expects, I still think this smells > bad. > > Feel free to convince me otherwise. I see your point. But most things in Ruby that are stolen from C behave JUST like the C counterparts. In fact, in many cases they are just wrappers. So I can understand why you don't like it. But my understanding is that you should blame C. Hal