Loading ...
Sorry, an error occurred while loading the content.

Re: another vim bug?

Expand Messages
  • John Doe
    I ve failed to see the reply :-( Thumbs up, Jürgen! Vielen Dank. ... __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new
    Message 1 of 14 , Apr 1, 2005
    • 0 Attachment
      I've failed to see the reply :-(

      Thumbs up, J�rgen! Vielen Dank.

      --- J�rgen Kr�mer <jkr@...> wrote:

      >
      > Hai,
      >
      > 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"
      > "04",
      > > 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!
      http://smallbusiness.yahoo.com/resources/
    Your message has been successfully submitted and would be delivered to recipients shortly.