Re: another vim bug?
- I've failed to see the reply :-(
Thumbs up, J�rgen! Vielen Dank.
--- J�rgen Kr�mer <jkr@...> wrote:
> John Doe wrote:
> > > John Doe wrote:
> > >
> > > > Check this out:
> > > > echo "09" + 0
> > > >
> > > > seems vim is unable to handle leading zeros.
> > >
> > > because you try to add a string and a number,
> VIM has to convert the
> > > string into a number first. Strings with leading
> zeroes are
> > > considered to be octal numbers, but 09 is not a
> valid octal number.
> > > Therefore "09" is converted to 0, leading to 0 +
> 0 which is 0.
> > Well it most definetly is problematic as
> > strftime("%H") returns decimal strings like "09"
> > etc.. String->number conversions break when it's
> nine o'clock.
> then remove those leading zeroes first:
> echo substitute(strftime('%H'), '^0*\(.\)', '\1',
> '') + 0
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!