lua-users home
lua-l archive

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


you might consider to include the "small printf" of mpaland (MIT license) in
the lua code.

This is quite recent (from 2018 I think - you find it with Google. This
gives a good impression, looks nicely programmed. (I did not test it myself
yet...). With this then it would be no problem to adapt this.

For me it would be also a very nice thing to include something like "%.3u"
as float specifier to allow "scientific unit notation" with milli, kilo, ...
(a, f, n, u, m, ' ', k, M, G, T, P). But this really is a bit too much
probably, ... just side remark... . You can do such formatting always also
"by some pre-function", then generating a new float and some additional
"unit char". But if it works directly this always has the VERY large
advantage, that you can possilby use the same formatting string for printf
and scanf (though scanf not available for lua... no problem.. at least a
"strtonumber" function supporting such format string sometimes would be
nice, but not really ímportant of course).



--
Sent from: http://lua.2524044.n2.nabble.com/Lua-l-f2524044.html