lua-users home
lua-l archive

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


> On Windows :
> os.setlocale('Portuguese - Brazil')
> io.read('*n') -- accepts the number
5,6 and not 5.6
> 
> os.setlocale('English')
> io.read('*n') -- back to '.'
> 
> -- 
> Marcos
> 

Wow! I would never guess that! Thanks
for the information!!


> You might want to be careful about the ',' separator. For example,
> 
> os.setlocale('Portuguese - Brazil')
> num = 5,6 --> num has a value of 5, though 5.6 might have been expected
> num = tonumber( "5,6" ) --> num has a value of 5.6
> 
> There are other places too like specifying table fields i.e. t = {1,23} vs t = {tonumber( "1,23" )}.
> 
> Tai

Sure. I don't expect the language to
change with os.setlocale. That would
be a mess. os.setlocale only changes
the library behavior.

 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/