lua-users home
lua-l archive

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


> > Due to the localisation problems I would like to suggest an official
> > enhanced tostring(). Additional to the standard usage tostring()

> This is not a good way to change tostring, which is a simple utility
> function for representing all objects as text. Things you might want to do
> to tostring include making it write out tables and userdata (rather than
> just as pointers), but extra formatting should be done by other functions.
> You could perhaps enhance format to do what you describe, for example.

You are right. Its better to enhance format() or write a complete new
function. I think format() also depends on locale as Rici wrote for
tostring() right?

If would I use format() then I prefer to enhance the format syntax and
not the arguments. But I don't feel good with any changes on format().

So now I try to solve the problem using standard format() syntax and a
little topping: removing trailing zeros, removing the comma on integers,
changing the comma from a locale into a defined char.

Thank you for your help - Rici and Thomas.


--
Markus