From: Akira Kakuto <[email protected]>
Date: 10 March 2019 at 15:27:09
> bad argument #2 to 'format' (number has no integer representation)
I think that this is a difference between lua-5.2 and lua-5.3.
lua-5.3 seems to require, for example:
string.format('%d', math.floor(math.pi))
Or string.format('%.0f',math.pi).
That will follow different rounding rules, though, so that if you feed it
math.exp(1), you get '3', not '2'.
Even the format string '%.f' gives the same result in practice, but only '%.0f'
guarantees the absence of a decimal point according to the specification (see
man sprintf).
– Harald