Dnia Sunday 13 of April 2008, Tony Mechelynck napisaƂ:
> I use C locale, where the decimal point is a period. Evaluating the
> string "2+2" gives the result 4, because the String has been evaluated
> as an expression. Similarly, evaluating the String "1.200000", which is
> also the string-representation of an expression, gives "1200000" which
> is the result of that expression -- a concatenated String. OTOH,
> eval("1,200000") gives an error "Trailing characters" because 1,200000
> cannot be seen as ONE expression -- i.e., "when we're finished parsing
> it, there's something left over", namely the comma and everything after
> it.
>
> If you had used ":let c = str2float(b)" then (IIUC -- I didn't try) the
> result would have come out equal to a. In a "decimal comma" locale,
> eval('&' . b) wouldn't have worked, you would have had to first replace
> the comma by a dot.

I know all about that and don't call it a but (questionable) but this
should be explained in docs.

m.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui