I am attempting to calculate the percentage of a value and then add it back to the original value using Vue.js. Here is an example: 5 / 100 * 900 + 900 = 945.00 (standard calculation)
5 / 100 * 900 + 900 = 90045 (Vue.js calculation)
This is the code I have written:
<td>
<input name="amount[]" v-model="row.amount" style="width: 94px;" type="text">
</td>
<td>
<select name="vat[]" v-model="row.vat" style="width: 94px;" class="form-control">
<option value="0" selected>0%</option>
<option value="5">5 %</option>
</select>
</td>
<td>
<input type="hidden" :value="row.vat / 100 * row.amount" v-model="gross_am">
<input value="" name="gross[]" :value="row.amount + gross_am" v-model="row.gross | currencyDisplay" style="width: 94px;"
type="text">
</td>
The purpose is to calculate the gross amount based on the user-entered amount and selected vat value, triggering the arithmetic operation where the vat percentage is added to the original amount to get the gross amount. Thank you. (I am still learning Vue.js)