[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: malformed number error?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 2 Dec 2003 22:56:16 -0200
>I'm getting "malformed number error"s from Lua 5.0 on any floating
>point constants in the script (i.e. "var=0.0001").
It seems a locale problem. The lexer uses strtod to convert strings to numbers
and strtod depends on the locale. However, decimal *points* are hardcoded
in the lexer and in some locales the right thing would be a decimal comma,
hence strtod returns an error.
Bottom line: set the locale to "C" before loading any (text) scripts.
I thought this had been discussed here before but I could not find it in the
archives...
--lhf