Lualatex function producing trailing characters
That's due to the change from lua 5.2 to lua 5.3.
You can force the number to be an integer e.g. with math.floor
:
\documentclass{article}
\directlua{
function underscore(s)
s = tostring(math.floor(s+2080))
tex.print(s)
end
}
\DeclareRobustCommand{\Binl}[1]{\directlua{underscore([[#1]])}}%
\begin{document}
Use M\Binl{1} or M\Binl{2}
\end{document}
s = tostring(math.floor(s+2080))