parseFloat not working with zero after decimal
<p>I have a text box , form the text box I need to pass a <strong>float</strong> value to a api.</p>

<p>Now things are working fine when I have value inside the text box as "18.575" or "18.09483".</p>

<p>But in case the value is "18.000" things are not working. I understand that 18.000 is same as 18 but I need the precision digits.</p>

<p>So problem is <strong>I need exact 18.00 in JavaScript and not 18</strong></p>

<p>I tried </p>

<p>a) <strong>parseFloat</strong></p>

<pre><code>  parseFloat("18.000");  // I get 18
</code></pre>

<p>b) <strong>toFixed</strong></p>

<pre><code> (18).toFixed(2) // I get `"18.00"` but it is string and doesn't solve the purpose.
</code></pre>

<p>c) <strong>Number</strong></p>

<p>Number("18.00") // gives 18 and not 18.00</p>

<p>Thanks in advance for help </p>