[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: tonumber metamethod?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 3 Jun 2005 12:23:19 -0300
> > Can't this be handled by setting a german locale?
> In my last attempt to handle numerical input, I setted the locale to
> pt_BR and voila, the parser stopped handling numeric constants :(
Yes, you have to be careful when parsing. I meant something like:
> I wish Lua had it's own neutral locale
The Lua core cannot call setlocale because it is not ANSI C.
The alternative is to parse and convert numbers by hand, which is quite subtle
to get it right for floating-point.