On Mon, Nov 12, 2012 at 2:14 PM, Victor Bombi <son...@telefonica.net> wrote: > Hello, > > this script: > > print(0.4) > require("wx") > print(0.4) > > does this output: > > 0.4 > 0,4 > > For me is very bad because I cant serialize floats. Is there any reason for > changing tostring method for numbers or could be reverted?
wxLua does not change the locale, but wxWidgets might to make the UI numeric display appropriate for users. What OS are you on? If you're in Linux you can apply the patch below and recompile the wxLua module lib. Please let me know if it works for you and I will apply it to svn. Regards, John Index: wxLua/modules/luamodule/luamodule.cpp =================================================================== --- C:/NOSCAN/wx/svnroot_wx/wx/wxLua/wxLua-trunk/trunk/wxLua/modules/luamodule/luamodule.cpp (revision 156) +++ C:/NOSCAN/wx/svnroot_wx/wx/wxLua/wxLua-trunk/trunk/wxLua/modules/luamodule/luamodule.cpp (working copy) @@ -192,6 +192,17 @@ return 0; } + #ifdef __WXGTK__ + // this call is very important since otherwise scripts using the decimal + // point '.' could not work with those locales which use a different symbol + // (e.g. the comma) for the decimal point... + // It doesn't work to put os.setlocale('c', 'numeric') in the Lua file that + // you want to use decimal points in. That's because the file has been lexed + // and compiler before the locale has changed, so the lexer - the part that + // recognises numbers - will use the old locale. + setlocale(LC_NUMERIC, "C"); + #endif + wxTheApp->SetExitOnFrameDelete(true); wxInitAllImageHandlers(); ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users