I was looking for a JavaScript built-in specifier to convert number in currency, but concluded that there is nothing built-in...
So, Does JavaScript really has no currency format specifier?
Meanwhile, I did a Google search and found that the following lines of code does this job
.ToFixed(0).replace(/./g, function(c, i, a) {
return i && c !== "." && ((a.length - i) % 3 === 0) ? ',' + c : c;
});
Any other / better way to convert number to currency with some understandable lines of code?
Please advise.