Convert number from text field to proper USD
<p>I have a script that on leaving a text field</p>

<pre><code>onblur="forA();"
</code></pre>

<p>converts a user input number to "number + USD" but it looks very unprofessional.  The script is:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function forA()
{
document.getElementById('field1').value = 
document.getElementById('field2').value +" USD";
}
&lt;/script&gt;
</code></pre>

<p>So this converts "<code>12345.75</code>" to "<code>12345.75 USD</code>".  Ughh.</p>

<p>Do you know how I can convert this number to its proper self? <code>12345.75</code> to <code>$12,345.75</code></p>

<p>My second, related question is in the same vain...</p>

<p>onclick="document.getElementById('field1').value = 
(Math.round((parseFloat(document.getElementById('11091').value,2)*100))/100 + 
Math.round((parseFloat(document.getElementById('1254.75').value,2)*100))/100).toFixed(2);"  </p>

<p>Can the value from field1 (12345.75) also be converted to "$12,345.75"</p>

<p>Thanks in advance.</p>
