Converting string to floating number Javascript
<p>I have a issue using variable in if condition. I have three variable where one is a string type and two more in Json. Here settings.DecimalDigits value is 2 or anything more than 2. </p>

<pre><code>var controlValue = integer + '.' + mantissa;
controlValue = parseFloat(controlValue).toFixed(settings.DecimalDigits);
</code></pre>

<p>integer &amp; mantissa will have a certain value which is stored in controlValue as string. <strong>controlValue</strong> is then compared with other two variables (<strong>settings.MaxValue &amp; settings.MinValue</strong>) in IF condition but its not going through condition as it type is <strong>string type</strong></p>

<pre><code>if (controlValue &gt; settings.MaxValue)
                controlValue = settings.MaxValue;

            if (controlValue &lt; settings.MinValue)
                controlValue = settings.MinValue;
</code></pre>

<p>In my parsing all three variables will have three values in floating type </p>

<p>controlValue = 123.23 or 123.00 <br/>
settings.MaxValue = 99.99 <br/>
settings.MinValue = -99.99 <br/>
 Please help so that the parsing goes through the <strong>IF Condition</strong></p>
