All,

Why does this fail?

irb(main):009:0> sprintf("%d", '08')
ArgumentError: invalid value for Integer: "08"
        from (irb):9:in `sprintf'
        from (irb):9

I assume it's because the 08 is being as an octal number prior to being 
changed to a decimal.  01 - 07 work fine, 09 breaks.

But I'm telling sprintf to interpret it as decimal, so why can't I have 
leading zeroes?

Please explain to me how this is expected behavior.

Thanks,
Wes

-- 
Posted via http://www.ruby-forum.com/.