lua-users home
lua-l archive

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


> You need to set the locale inside Lua:
> 
> 	% lua
> 	Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> 	> os.setlocale"fr_FR"
> 	fr_FR
> 	> "3,14" + 1
> 	4,14

os.setlocale("") is a better solution because it reads the locale from
the environment:

	env LC_NUMERIC="fr_FR.UTF-8" lua
	Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
	> os.setlocale("")
	en_US.ISO8859-1/en_US.ISO8859-1/en_US.ISO8859-1/fr_FR.UTF-8/en_US.ISO8859-1/en_US.ISO8859-1
	> "3,14" + 1
	4,14