--html--
<table>
<tr>
<th>a</th>
<th>b<th>
</tr>
<tbody class = "tabledata">
<tr>a</tr>
<tr>b</tr>
</tbody>
</table>
--jquery--
$('.tabledata').empty();
for (var i = 0; i < result.length; i++) {
var abc = '<tr><td>' + result[i]['a'] + '</td><td>' + result[i]['b'] + '</td></tr>'
//var results = abc.replace(/-(.*)/, "()");
$('.tabledata').append(abc);
}
the result carries negetive values such as -245.1, -897.7. I want to change them as (245.1) and (897.7). I have tried .replace function but could not get it work.