Lua string.format ("%d") fails for some integers
<p>I am using lua 5.3.2 and the following piece of code gives me an error:</p>

<pre><code>string.format("%d", 1.16 * 100)
</code></pre>

<p>whereas the following line works fine</p>

<pre><code>string.format("%d", 1.25 * 100)
</code></pre>

<p>This is probably related to <a href="https://stackoverflow.com/q/31577104/450836">this question</a> but the failure depends on the floating point value. Given that, in my case, a local variable (v) holds the float value, and is generated by an expresson that produces a value between 0 and 2 rounded to 2 decimal places.</p>

<p>How can I modify the code to ensure this doesn't fail for any possible value of v ?</p>