Just add + " Dollars"(or Rupees, etc.) to what you return from the function:
$("#myelement").text(function () {
return $(this).text().replace(/\,/g, '.') + " Dollars";
});
Note that as georg points out , you donβt need the part $(this).text(), the callback gets the index and old text as arguments:
$("#myelement").text(function(index, text) {
return text.replace(/\,/g, '.') + " Dollars";
});
: , , ( ). /,/g, /\,/g.