lua-users home
lua-l archive

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


Hi,

Matthew Armstrong wrote:
> When reading a comparison between lua and python:
> http://lua-users.org/wiki/LuaVersusPython
> 
> I ran across this item:
> Floating point numbers locale bug. Lua needs some dirty hacks to keep your
> scripts working when using floating point numbers.

Well, that page seems to have grown into a flamefest. Anyway, the
statement is simply untrue. Lua 5.1 deals with this properly:

$ lua
Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
> = 1.2
1.2
> os.setlocale("de_DE@euro", "numeric")
> = 1.2
1,2

I don't think that setting the numeric locale is a good idea in
general. But Lua's parser still works. It has an explicit
workaround for parsing floating-point numbers in non-standard
locales.

Bye,
     Mike