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()
optional receives a decimal separator and a thousands separator
char/string. So we can use the locale depending tostring() and a defined
behaviour too.

e.g. print(tostring(1234.56,","," ")) --> 1 234,56
tostring(number [,string decimal sep. [,string thousands sep.]])

or leftside optional arguments:

e.g. print(tostring(",",".",1234.56)) --> 1.234,56
tostring([string decimal sep., [string thousands sep.,]] number)

I know its possible to do this tostring() enhancement direct in Lua. But
then its not as fast and possible not compatible with future tostring

Any suggestions are welcome. Thank you