lua-users home
lua-l archive

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


> Umm ... what does "%i.4" do?

man sprintf


> There's hardly a genuine situation in which
> 
>    string.format( "%i", 2^31 )  -->  -2147483648
> 
> is a reasonable or desirable outcome?

Lua (as everything else) is a tradeoff between several conflicting
goals. I do not think this problem is worth the complexity of its
fix. If you want %.0f when you write "%i", write "%.0f".

-- Roberto