How do I replace an empty form field with a 0 in order to prevent NaN in JQuery?
<p>HTML</p>

<pre><code>&lt;input type='text' id='costs' value='100' size='3'&gt;&lt;/input&gt;
</code></pre>

<p>JQuery</p>

<pre><code>var costs = $("#costs");
var c = parseFloat(costs.val().replace(",",".")); //germany ;)
costs.text(c);
</code></pre>

<p>If I leave the input field empty I get NAN. What do I have to change to replace the input field with a 0 if it is empty? </p>
