How to calculate numbers with dot thousand separator in javascript <p>I've converted numbers using php number format as follows:</p> <pre><code>number_format($X, 2, ',', '.'); </code></pre> <p>which converts </p> <pre><code>5000000 </code></pre> <p>into</p> <pre><code>5.000.000,00 </code></pre> <p>which is exactly what I wanted.</p> <p>But now my javascript function which is doing some basic math on those numbers are giving wrong result, for example:</p> <pre><code>5.000.000,00 - 3.500.000,00 = 1.5 instead of 1.500.000,00 </code></pre> <p>So how do you properly calculate those numbers in javascript?</p> <p>I really appreciate any help i can get :D</p> <p>Thanks y'all</p>