Question: ```
<input 
    ngModel 
    name='quantity'
    placeholder='Quantity'
    type="number"
    class="form-control"
    pattern="^\d*(\.\d{0,2})?$" 
    required />

<input
    ngModel
    name='price'
    class="form-control"
    placeholder='Price'
    type="number"
    required />

<input 
    name='total' 
    class="form-control" 
    type="number" 
    [value]='addRowForm.value.quantity * addRowForm.value.price' />

```

I have three input fields **Quantity, Price, Total**, The multiplication of quantity and price should be shown in the Total field, I can do this in Typescript code, But I wonder there is a simple solution to do it solely in the template.

I have tried this but it doesn't work.

`[value]='addRowForm.value.quantity * addRowForm.value.price'`

Answer: 
Add `[(ngModel)]` in the fields.

Try like this:

**[Working Demo](https://stackblitz.com/edit/angular-qqjhbx?embed=1&file=src/app/app.component.html)**

```
<input [(ngModel)]="quantity" name='quantity' placeholder='Quantity' type="number" class="form-control" pattern="^\d*(\.\d{0,2})?$" required />

<input [(ngModel)]="price" name='price' class="form-control" placeholder='Price' type="number" required />

<input name='total' class="form-control" type="number" [(ngModel)]='quantity * price' />

```

You can also use it like this:

**[Demo](https://stackblitz.com/edit/angular-lsgbfy?embed=1&file=src/app/app.component.html)**

TS:

```
newRowDetails = {}

```

Template:

```
<input [(ngModel)]="newRowDetails.quantity" name='quantity' placeholder='Quantity' type="number" class="form-control" pattern="^\d*(\.\d{0,2})?$" required />

<input [(ngModel)]="newRowDetails.price" name='price' class="form-control" placeholder='Price' type="number" required />

<input name='total' class="form-control" type="number" [(ngModel)]='newRowDetails.quantity * newRowDetails.price' />

```
Try this, use *double quotes* to evaluate the value of your variable.

```
<input  name="total" class="form-control" type="number" [value]="addRowForm.value.quantity * addRowForm.value.price" />

```