I was able to find the following script to format currency with commas but for some reason it keeps dropping the trailing zero.

For example, if the amount is $11,750.10 it formats it as "$11,750.1".

I've played around with this for the last day or so without any luck. I need some Java expertise as I'm a VB person.
===============================
function formatCurrency(n,d) // n = number, d = delimeter
{
// round to 2 decimals if cents present
n = (Math.round(n * 100) / 100).toString().split('.');
var
myNum = n[0].toString(),
fmat = new Array(),
len = myNum.length,
i = 1, deci = (d == '.') ? ',' : '.';
for(i; i < len + 1; i++) fmat[i] = myNum.charAt(i-1);

fmat = fmat.reverse();
for(i = 1; i < len; i++)
{
if(i % 3 == 0) {
fmat[i] += d;
}
}
var val = fmat.reverse().join('') +
( n[1] == null ? deci + '00' :
(deci + n[1])
);
}
return val;
}
=======================

Thanks in advance!

Kevin