Does anyone know how to create a Javascript function for a web report that converts table values to thousands or millions by dividing or multiplying by 1000?
The issue is that each value is clickable, meaning it is wrapped in an anchor tag.
Is there a way to achieve this?
<table class="Table" >
<thead><tr>
<th class="l Header" scope="col">£000s</th>
<th class="l Header" scope="col">Col1</th>
<th class="l Header" scope="col">Col2</th>
</tr></thead>
<tbody>
<tr>
<td class="l Data"> My Data Row </td>
<td class="l Data"> <a class=nums href="javascript:MyFunc();"> 11,372,397</a></td>
<td class="l Data"> <a class=nums href="javascript:MyFunc();"> 11,344,327</a></td>
</tr>
</tbody>
edit
I am using IE6. The goal is to have buttons for 'thousands' and 'millions' so that the table values can be displayed as 11,372k or 11.4m, etc.