There are way too many questions and answers about this basic functionality, I cannot see the wood for the trees.
In Java there is only one simple answer (jav
Putting this http://www.mredkj.com/javascript/numberFormat.html and $('.number').formatNumber();
concept together, you may use the following line of code;
e.g. <td class="number">1172907.50</td>
will be formatted like <td class="number">1,172,907.50</td>
$('.number').text(function () {
var str = $(this).html() + '';
x = str.split('.');
x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
$(this).html(x1 + x2);
});
If you need to handle multiple currencies, various number formats etc. I can recommend autoNumeric. Works a treat. Have been using it successfully for several years now.