In my AngularJS math operations, I am encountering an issue where the percentage/VAT price is displaying as 0.35000000000000003 instead of just 0.35. How can I trim the decimals after 2 digits?
0.35000000000000003 - Is there a way to limit this number to only 2 decimal places?
<table align="center">
<h2>Tax Calculations</h2>
<tr>
<td>
Quantity:
</td>
<td>
<asp:TextBox runat="server" ng-model="qty"/>
</td>
</tr>
<tr>
<td>
Unit Price:
</td>
<td>
<asp:TextBox runat="server" ng-model="price"/>
</td>
</tr>
<tr>
<td>
Total Amount:
</td>
<td>
<asp:TextBox runat="server" Text='{{qty * price}}' ReadOnly="true"/>
</td>
</tr>
<tr>
<td>
VAT Price at 5%:
</td>
<td>
<asp:TextBox runat="server" Text='{{(qty * price )/100 * 5}}' ReadOnly="true"/>
</td>
</tr>
<tr>
<td>
Total With Tax:
</td>
<td>
<asp:TextBox runat="server" Text='{{((qty * price )/100 * 5) + (qty*price)}}' ReadOnly="true"/>
</td>
</tr>
</table>