Hi. I am using this in my Test Script to visualize the response:
<table class="tftable" border="1">
<tr>
<th>Response 1</th>
<th>Response 2</th>
<th>Response 3</th>
</tr>
{{#each response}}
<tr>
<td>{{response_1}}</td>
<td>{{response_2}}</td>
<td>{{response_3}}</td>
</tr>
{{/each}}
</table>
If {{response_1}} always returns a number (or string of numbers), how do I display {{response_1}} divided by 100? The result would need to be a floating-point with 2 decimals.
I know I need to do something like this:
(parseFloat({{response_1}})/100).toFixed(2);
I am just not sure of the correct syntax to use between the td tags.
I have tried creating a global variable with value “(parseFloat({{response_1}})/100).toFixed(2);”
and then I use ${pm.globals.get(“myVariable”)} but this does not work. It simply displays “(parseFloat({{response_1}})/100).toFixed(2);” in the cell.