lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>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