Changing single digit number to double digit in javascript
<p>How can I add a zero to a to the output for a percentage?
Here is the code:</p>

<pre><code>    var margin = 0;             
    if(total_quantity&gt;1000){margin = .32;}
    else if(total_quantity&gt;575){margin = .35;}
    else if(total_quantity&gt;143){margin = .36;}
    else if(total_quantity&gt;71){margin = .38;}
    else if(total_quantity&gt;36){margin = .40;}
    else{margin = .55;} 
    document.getElementById('margin').value=margin;
</code></pre>

<p>The output of the .40 margin is always 4%. I need it to be 40%</p>
