From: David Vallner Date: 2006-08-19T04:45:26+09:00 Subject: Re: Bug in sprintf? Wes Gamble wrote: > 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. Declare your intent by doing '08'.to_i(10) instead. In fact, declare your intent in the first place that way. Expecting sprintf to be automagical the way you expect out of two incompatible, but perfectly valid interpretations isn't much to rely on. Code everything explicitly and you'll get predictable results. I'll join the club of people wondering why the String->Integer coercion is happening in the first place. David Vallner