Performance: toFixed() vs. Math.floor(x * 10000)
<p>I need to compare two float values to a certain precision (that is 4 decimal places):</p>

<pre><code>var float1 = 0.0025132741228718345;
var float2 = 0.0025132812393818293;
</code></pre>

<p>The two options I see:</p>

<pre><code>Math.floor(float1 * 10000) === Math.floor(float2 * 10000); // 25 === 25
</code></pre>

<p>...or:</p>

<pre><code>float1.toFixed(4) === float2.toFixed(4) // "0.0025" === "0.0025"
</code></pre>

<p>Since operation will happen 60 times a second and I was asking myself:</p>

<ol>
<li>which of the options has the higher performance?</li>
<li>is one of the options more widely accepted?</li>
<li>is there a third option?</li>
</ol>