lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo <lhf <at> tecgraf.puc-rio.br> writes:

> > is there any particular reason why there is a tostring but not a
> > tonumber metamethod?

> No reason, except that it never came up. What would you use a tonumber
> metamethod for?

Well, tonumber accepts only numbers like "42.23", not "1,042.23" or "1.032,42"
(german number format). Wouldn't be a tonumber-metamethod the right place for
this? Or is it cleaner to implement this in a function of its own?

Kind regards, Markus