Currently within our credit memo PDF form, the values are all displayed as positive values. However the business have decided that they would like to see the signs flipped so that the values and quantities both at line level and within the subtotal and total are shown as negitive numbers. This is because there will be lines that are actually an increase in quantities, that the business want to show as a positive.
Anyway, I've managed to make the change on the line level, but struggling with making the change for the sub total and total. The reason is because within the sub total the value is converted to a string so that it can be displayed with 2 decimal places. The current code is this for the subtotal:
<table class="total" style="width: 100%; margin-top: 10px;">
<tr>
<td colspan="4"> </td>
<td align="right"><b>Sub Total</b></td>
<td align="right">${record.subtotal?string[",##0.00"]}</td>
</tr>
<tr>
Basically, I was to multiple whatever the subtotal amount is by -1 so that it is displayed as a negative, but still show it to 2 decimal places. Because it gets converted to a string, if I just multiple by -1 I get an error as you can't multiple a string by a number. Is there a way to do the calculation first and then convert to a string?
Many thanks